Fix UC to UC copying regression#19280
Conversation
Signed-off-by: Ben Wilson <benjamin.wilson@databricks.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression introduced in PR #17458 that broke cross-workspace UC model copying. The regression made model_id effectively required by not handling cases where the logged model lookup fails due to the model being in a different, inaccessible workspace.
Key Changes:
- Added exception handling to gracefully handle
RESOURCE_DOES_NOT_EXISTerrors when retrieving logged models by ID - Added debug logging to document the cross-workspace scenario
- Added comprehensive test coverage for the new error handling logic
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
mlflow/store/_unity_catalog/registry/rest_store.py |
Added try-catch block in _get_logged_model_from_model_id to handle RESOURCE_DOES_NOT_EXIST exceptions and return None instead of failing, enabling cross-workspace model copying |
tests/store/_unity_catalog/model_registry/test_unity_catalog_rest_store.py |
Added three test cases covering success, None input, and resource-not-found scenarios for _get_logged_model_from_model_id |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/store/_unity_catalog/model_registry/test_unity_catalog_rest_store.py
Show resolved
Hide resolved
|
Documentation preview for 4ac9de9 is available at: More info
|
serena-ruan
left a comment
There was a problem hiding this comment.
LGTM! Could we add a test checking create_model_version is not blocked if the model is not found?
Great idea @serena-ruan - verifying the behavior that existed prior to the change made in 3.4.0 addresses the original test coverage gap that allowed the regression to happen in the first place. Thanks for calling this out :D I'll add that test prior to merging. Appreciate it! |
Signed-off-by: Ben Wilson <benjamin.wilson@databricks.com>
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Fixes a regression accidentally introduced in #17458 that made
model_idrequired in the abstract implementation, forcing the UC registry store to fail for the previously working path of copying models across workspaces (which was entirely functional prior to 3.4.0).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.