Skip to content

Conversation

@harupy
Copy link
Member

@harupy harupy commented Oct 15, 2025

Related Issues/PRs

Follows up on #18295 which added link_traces_to_run.

What changes are proposed in this pull request?

Adds unlink_traces_from_run() batch operation to MlflowClient and DatabricksRestStore for unlinking traces from runs (V4 traces only).

How is this PR tested?

  • New unit/integration tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Added unlink_traces_from_run() method to MlflowClient for batch unlinking traces from runs.

What component(s), interfaces, languages, and integrations does this PR affect?

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality

How should the PR be classified in the release notes? Choose one:

  • rn/feature - A new user-facing feature worth mentioning in the release notes

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)

🤖 Generated with Claude Code

Implements batch unlinking of traces from runs, complementing the existing
`link_traces_to_run` functionality added in mlflow#18295.

Changes:
- Add `unlink_traces_from_run` to `AbstractStore` with default NotImplementedError
- Implement `unlink_traces_from_run` in `DatabricksRestStore` with V4 batch API support
- Add `_group_traces_by_location` helper to reduce code duplication
- Add `unlink_traces_from_run` method to `MlflowClient`
- Add comprehensive tests for V4 traces, V3 error handling, and multi-location grouping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: harupy <[email protected]>
@github-actions github-actions bot added area/tracing MLflow Tracing and its integrations area/tracking Tracking service, tracking client APIs, autologging rn/feature Mention under Features in Changelogs. labels Oct 15, 2025
@harupy
Copy link
Member Author

harupy commented Oct 15, 2025

/review


🚀 Review workflow started

@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

Documentation preview for 952de66 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

@harupy
Copy link
Member Author

harupy commented Oct 15, 2025

/review


🚀 Review workflow started

Copy link
Collaborator

@serena-ruan serena-ruan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left some nits :)

- Simplify _group_traces_by_location by reusing the same variable name
  for trace_id instead of having separate otel_trace_id variable
- Update error message to avoid mentioning V3/V4 terminology, instead
  focusing on UC schema location requirement
- Update test assertions to match the new error message

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: harupy <[email protected]>
@harupy harupy added this pull request to the merge queue Oct 15, 2025
Merged via the queue into mlflow:master with commit 6c63b0c Oct 15, 2025
67 of 69 checks passed
@harupy harupy deleted the add-unlink-traces-from-run branch October 15, 2025 13:28
serena-ruan pushed a commit to serena-ruan/mlflow that referenced this pull request Oct 16, 2025
serena-ruan pushed a commit that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tracing MLflow Tracing and its integrations area/tracking Tracking service, tracking client APIs, autologging rn/feature Mention under Features in Changelogs. v3.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants