get_trace support for stores#18556
Conversation
6743be6 to
51e815f
Compare
|
Documentation preview for 5d8cc32 is available at: More info
|
41211da to
e023a53
Compare
mlflow/protos/service.proto
Outdated
| // Whether to allow partial traces. Default to True. | ||
| optional bool allow_partial = 2 [default = true];; | ||
| // Whether to allow partial traces. Default to False. | ||
| optional bool allow_partial = 2 [default = false];; |
There was a problem hiding this comment.
Updating the default value to False since after second thought I think that the only case that users may want to fetch in-progress trace is through MLflow UI. There's no specific reason user may want to get in-progress traces using SDK, and mlflow.get_trace is depended by lots of places like eval so we should retry to fetch the trace by default.
|
|
@harupy Haha we're not having standup today, you can leave async updates in slack afterwards |
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
7edfb9e to
f074bcd
Compare
|
/review ✅ Review completed. Review OutputPR Review CompleteI've reviewed PR #18556 "get_trace support for stores" and found 6 issues that need attention: Critical Issues (Bugs):
Style Guide Violations:
The most critical issues are #1 (missing import) and #3 (None return bug) as they will cause runtime failures. I've added detailed review comments with suggestions for each issue on the PR. |
| # allow partial so the front end can render in-progress traces | ||
| trace = _get_tracking_store().get_trace(request_id, allow_partial=True) | ||
| except MlflowTracingException: | ||
| pass | ||
| except MlflowNotImplementedException: | ||
| # default to batch get traces if get_trace is not implemented | ||
| try: | ||
| traces = _get_tracking_store().batch_get_traces([request_id], None) | ||
| # For stores that don't support batch get traces, or if the trace data is not stored in the | ||
| # tracking store, we need to get the trace data from the artifact repository. | ||
| except (MlflowTracingException, MlflowNotImplementedException): | ||
| pass | ||
| else: | ||
| if len(traces) != 1: | ||
| raise MlflowException( | ||
| f"Trace with id={request_id} not found.", | ||
| error_code=RESOURCE_DOES_NOT_EXIST, | ||
| ) | ||
| trace_data = traces[0].data.to_dict() | ||
| else: | ||
| trace_data = trace.data.to_dict() |
There was a problem hiding this comment.
A helper function doesn't help simplify the code?
There was a problem hiding this comment.
Emm we can move this part to a helper function, but I don't think it'll be simpler.
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
Signed-off-by: Serena Ruan <serena.rxy@gmail.com>
🥞 Stacked PR
Use this link to review incremental changes.
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.