Skip to content

fix(mlflow): mlflow3.x mlfeatures (#32024) - #32091

Merged
pmbrull merged 4 commits into
1.13from
fix/mlflow3_mlfeatures_1.13
Sep 2, 2026
Merged

pmbrull merged 4 commits into
1.13from
fix/mlflow3_mlfeatures_1.13

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

cherry-picking 9487c78 from main

Fixes #31889


Summary by Gitar

  • Mlflow features:
    • Added support for MLflow 3.x signature extraction from MLmodel artifact metadata when run tags are absent
  • Registry pagination & safeguards:
    • Implemented pagination support for registered model listings with bounds and completion checks to prevent unsafe deletions

This will update automatically on new commits.

Greptile Summary

The PR adds MLflow 3.x feature extraction from MLmodel artifacts and makes registered-model discovery paginated and deletion-aware.

  • Falls back from legacy run tags to artifact metadata for model signatures.
  • Resolves MLflow 3.x logged-model URIs before downloading metadata.
  • Tracks registry-listing completeness to guard deletion reconciliation.
  • Adds unit coverage for signatures, pagination, malformed metadata, and deletion safeguards.

Confidence Score: 5/5

The PR appears safe to merge based on the available follow-up context.

No blocking failure remains.

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/mlmodel/mlflow/metadata.py Adds paginated registry traversal, guarded deletion reconciliation, and MLflow 3.x artifact-based signature extraction without an eligible blocking finding.
ingestion/tests/unit/source/mlmodel/mlflow/test_metadata.py Adds broad unit coverage for feature extraction, pagination, malformed signatures, and deletion safeguards.

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]
Loading

Reviews (4): Last reviewed commit: "Merge branch '1.13' into fix/mlflow3_mlf..." | Re-trigger Greptile

* 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]>
@harshsoni2024
harshsoni2024 requested a review from a team as a code owner August 26, 2026 10:00
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Adds 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

📄 ingestion/src/metadata/ingestion/source/mlmodel/mlflow/metadata.py:83-94 📄 ingestion/src/metadata/ingestion/source/mlmodel/mlflow/metadata.py:517
The context manager sets/restores MLFLOW_ENABLE_ARTIFACTS_PROGRESS_BAR on the shared os.environ. If ingestion ever runs multiple sources/artifact fetches concurrently in the same process, overlapping enter/exit could restore a stale value or leak the override. It is safe under the current single-threaded ingestion flow; note the assumption or scope the setting to the MLflow call if concurrency is later introduced.

✅ Edge Case: Empty signature inputs trigger redundant artifact fallback

📄 ingestion/src/metadata/ingestion/source/mlmodel/mlflow/metadata.py:469-470 📄 ingestion/src/metadata/ingestion/source/mlmodel/mlflow/metadata.py:527-529
When a run tag (or MLmodel file) has a signature whose inputs is an explicitly empty list [], the truthiness check if inputs else None treats it identically to a missing signature, setting columns = None. In _get_ml_features this makes a model with a valid-but-empty signature fall through to _signature_columns_from_artifacts, causing an unnecessary download_artifacts network call per such model. This is harmless functionally but wastes a round-trip; consider distinguishing inputs is None from inputs == [].

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@pmbrull
pmbrull merged commit 012c2ac into 1.13 Sep 2, 2026
119 of 125 checks passed
@pmbrull
pmbrull deleted the fix/mlflow3_mlfeatures_1.13 branch September 2, 2026 05:46

This branch was previously deployed

1 inactive deployment
test — c45eb195 Deployed Sep 1, 2026 by harshsoni2024 via playwright-ci-postgresql (6, 6) #76292
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants