FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Add MLflow as a first-class offline DataSource for Feast by Vperiodt · Pull Request #6702 · feast-dev/feast · GitHub

feat: Add MLflow as a first-class offline DataSource for Feast - #6702

Open
Vperiodt wants to merge 12 commits into
feast-dev:masterfrom
Vperiodt:mlflow-datasource
Open

feat: Add MLflow as a first-class offline DataSource for Feast#6702
Vperiodt wants to merge 12 commits into
feast-dev:masterfrom
Vperiodt:mlflow-datasource

Conversation

Vperiodt commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds MlflowDatasetSource so Feast can read tabular MLflow data for offline retrieval via get_historical_features() and create_saved_dataset().

  • Dual-mode source: GenAI Dataset (dataset_name/dataset_id) and artifact (run_id + artifact_path, Parquet/CSV)
  • Offline support: DuckDB/ibis direct read, plus to_arrow() fallback for other stores
  • Auth: Bearer token propagation from Feast requests to MLflow (request context → env → ServiceAccount)
  • CLI: sync-dataset, preview-dataset, validate-source, list-sources
  • Graceful degradation when mlflow is not installed; non-MLflow FeatureViews unaffected

Which issue(s) this PR fixes:

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Misc

Signed-off-by: Vanshika Vanshika <vvanshik@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Vperiodt requested a review from a team as a code owner August 4, 2026 18:59

codecov-commenter commented Aug 4, 2026
edited
Loading

Copy link
Copy Markdown

⚠️ Please install the to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 53.25248% with 424 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.31%. Comparing base (f0bc070) to head (9c0bd21).

Files with missing lines Patch % Lines
sdk/python/feast/cli/mlflow_cmd.py 0.00% 179 Missing ⚠️
...dk/python/feast/mlflow_integration/dataset_sync.py 44.55% 136 Missing and 27 partials ⚠️
...infra/data_sources/mlflow/mlflow_dataset_source.py 84.93% 26 Missing and 10 partials ⚠️
sdk/python/feast/infra/data_sources/mlflow/auth.py 80.98% 20 Missing and 7 partials ⚠️
sdk/python/feast/infra/offline_stores/ibis.py 11.11% 8 Missing ⚠️
sdk/python/feast/infra/offline_stores/duckdb.py 12.50% 7 Missing ⚠️
sdk/python/feast/permissions/security_manager.py 66.66% 2 Missing ⚠️
sdk/python/feast/permissions/server/arrow.py 0.00% 1 Missing ⚠️
sdk/python/feast/permissions/server/rest.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

@@            Coverage Diff             @@
##           master    #6702      +/-   ##
==========================================
+ Coverage   47.09%   47.31%   +0.22%     
==========================================
  Files         419      424       +5     
  Lines       51878    52784     +906     
  Branches     7525     7675     +150     
==========================================
+ Hits        24430    24974     +544     
- Misses      25700    26017     +317     
- Partials     1748     1793      +45     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.61% <53.25%> (+0.21%) ⬆️
Files with missing lines Coverage Δ
...python/feast/infra/data_sources/mlflow/__init__.py 100.00% <100.00%> (ø)
sdk/python/feast/mlflow_integration/config.py 89.06% <100.00%> (+89.06%) ⬆️
sdk/python/feast/permissions/server/arrow.py 52.38% <0.00%> (-1.28%) ⬇️
sdk/python/feast/permissions/server/rest.py 35.29% <0.00%> (-1.07%) ⬇️
sdk/python/feast/permissions/security_manager.py 92.04% <66.66%> (-1.86%) ⬇️
sdk/python/feast/infra/offline_stores/duckdb.py 36.58% <12.50%> (-0.61%) ⬇️
sdk/python/feast/infra/offline_stores/ibis.py 38.99% <11.11%> (-1.21%) ⬇️
sdk/python/feast/infra/data_sources/mlflow/auth.py 80.98% <80.98%> (ø)
...infra/data_sources/mlflow/mlflow_dataset_source.py 84.93% <84.93%> (ø)
...dk/python/feast/mlflow_integration/dataset_sync.py 44.55% <44.55%> (ø)
... and 1 more

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0bc070...9c0bd21. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Vperiodt and others added 4 commits August 8, 2026 15:47

ntkathole left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the feature! A few concerns — mostly around thread-safety and error handling.



@contextlib.contextmanager
def mlflow_token_scope(token: Optional[str]) -> Iterator[None]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

os.environ is process-global — concurrent requests in a multi-threaded Feast server will race over MLFLOW_TRACKING_TOKEN, potentially leaking tokens between users. Same issue applies to mlflow.set_tracking_uri() calls throughout the PR.

f"Unsupported artifact format: {self.artifact_format}"
)

def _fetch_genai_dataframe(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This method never calls resolve_mlflow_token() or wraps in mlflow_token_scope(), so schema introspection will fail with 401 in authenticated deployments. Compare with to_arrow() which correctly handles auth.

try:
store.write_to_offline_store(feature_view_name, batch)
except Exception as e:
logger.warning(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Offline write errors are logged but NOT added to result.errors, so the watermark can still advance even when offline data is lost. Those records become unrecoverable on the next incremental sync.

assert "score" in result_df.columns
assert "category" in result_df.columns
except Exception:
pytest.skip(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Catching all Exception types and calling pytest.skip means this test can never fail — any bug (AssertionError, TypeError, etc.) is silently skipped. This provides zero regression safety.

if view is None:
return None

for attr in ("stream_source", "source", "data_source"):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

When FeatureView(source=MlflowDatasetSource(...)) is used, the source is stored as batch_source. This lookup checks stream_source, source, data_source but not batch_source.

Copy link
Copy Markdown
Member

@Vperiodt linting fails

Signed-off-by: Vanshika Vanshika <vvanshik@redhat.com>
Signed-off-by: Vanshika Vanshika <vvanshik@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL