Repository navigation
fix(mlflow): mlflow3.x mlfeatures (#32024) - #32091
Conversation
* fix(mlflow): read model signatures from the MLmodel file on MLflow 3.x MLflow 3.x dropped the `mlflow.log-model.history` run tag in favour of LoggedModel entities, so `data.tags["mlflow.log-model.history"]` raised KeyError on every model. The broad except swallowed it, leaving mlFeatures empty and emitting a spurious warning per model. No metadata API exposes the signature -- not the MLflow logged-model endpoint, nor either Unity Catalog model-version endpoint -- so it can only be read from the model's own MLmodel file. Fetch just that one file. `mlflow.models.get_model_info` is deliberately avoided: it resolves `models:/` URIs through MLflow's global tracking config, which this connector never sets, and it imports pandas, which mlflow-skinny does not ship. Both make it fail on Unity Catalog. Resolving the artifact location through the connector's own client and parsing the YAML with json avoids each. `mlflow.artifacts.load_text` would be tidier but takes no tracking_uri, so it hits the same global-config problem. A missing tag now logs at debug rather than warning, since it is the norm on 3.x, and a tag with no entry for the run falls through to the artifacts instead of returning early. Co-Authored-By: Claude Opus 5 <[email protected]> (cherry picked from commit 1ab63cd) * fix(mlflow): stop a bad signature or partial listing from losing models Guard the ML-feature build: a malformed signature escaped yield_mlmodel, and the topology runner drops the entity without recording a failure, so the model vanished silently. Also skip deletion reconciliation when the registry listing was truncated, since models beyond the page budget would be wrongly marked deleted. Co-Authored-By: Claude Opus 5 <[email protected]> (cherry picked from commit 8931369) * fix(mlflow): never reconcile deletions off a listing we cannot trust Track listing completion positively instead of tracking truncation, and reset it per run, so an abandoned, failed or never-started listing fails closed rather than licensing soft-deletes. Also skip reconciliation when the registry listed no models at all -- a wrong `registryUri` or credentials that cannot list are indistinguishable from an emptied registry, and acting on it deletes every model under the service. Adds the regression test for the reporter's registry shape: an empty first page that still carries a page token, which the old single-call listing read as "no models" and reported as a fully successful run. --------- Co-authored-by: Claude Opus 5 <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
Code Review ✅ Approved 2 resolved / 2 findingsAdds MLflow 3.x signature extraction and registry pagination safeguards. Consider addressing the empty signature inputs fallback and process-global environment variable mutation in suppress_artifact_progress_bar. ✅ 2 resolved✅ Quality: suppress_artifact_progress_bar mutates process-global os.environ
✅ Edge Case: Empty signature inputs trigger redundant artifact fallback
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



cherry-picking 9487c78 from main
Fixes #31889
Summary by Gitar
MLmodelartifact metadata when run tags are absentThis will update automatically on new commits.
Greptile Summary
The PR adds MLflow 3.x feature extraction from
MLmodelartifacts and makes registered-model discovery paginated and deletion-aware.Confidence Score: 5/5
The PR appears safe to merge based on the available follow-up context.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Enumerate registered models] --> B{More pages?} B -->|Yes| A B -->|No| C[Select latest model version] C --> D{Signature in run tag?} D -->|Yes| E[Build ML features] D -->|No| F[Resolve artifact location] F --> G[Download MLmodel metadata] G --> E E --> H[Publish ML model] H --> I{Listing complete and non-empty?} I -->|Yes| J[Reconcile deleted models] I -->|No| K[Skip deletion reconciliation]Reviews (4): Last reviewed commit: "Merge branch '1.13' into fix/mlflow3_mlf..." | Re-trigger Greptile