← 输入框|github.com|刷新
Skip to content

feat: Add PolarisSource and PolarisProvider for Apache Polaris - #7006

Merged
haoxu0 merged 3 commits into
feast-dev:masterfrom
haoxu0:feat/polaris-source
Oct 15, 2026
Merged

haoxu0 merged 3 commits into
feast-dev:masterfrom
haoxu0:feat/polaris-source

Conversation

@haoxu0

@haoxu0 haoxu0 commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Adds Apache Polaris support on top of the Iceberg REST catalog integration (iceberg_catalog contrib), mirroring the Unity Catalog layering from #6499.

  • PolarisSource(IcebergSource): endpoint defaults to $POLARIS_HOST/api/catalog; OAuth2 client-credentials or bearer-token auth read from env vars (only the variable names are stored in the registry); credential vending for reads/writes; PolarisSource.discover() builds sources for tables in a catalog.
  • PolarisClient: OAuth client-credentials token acquisition with refresh before expiry, and table property updates via the standard Iceberg REST updateTable (set-properties / remove-properties).
  • PolarisProvider (provider: polaris): on feast apply, records feast.project, feast.feature_view, feast.owner, feast.description, feast.tag.* and feast.is_feature_table on the backing Polaris tables. A deleted feature view keeps the table and marks it feast.is_feature_table=false + feast.deleted_at. A failed sync is logged and never fails feast apply.
  • Refactor: the PyIceberg REST catalog config was duplicated in three places (DuckDB read, DuckDB write, Spark). It now lives in IcebergSource.get_pyiceberg_catalog_config() / load_pyiceberg_table() so subclasses can override it. Behavior for existing IcebergSource users is unchanged (covered by a test).

Polaris has no lineage API, so there is no sync_lineage equivalent.

Not included (follow-up): column projection / predicate pushdown on the read path, which needs changes to how the offline stores call into the source. Multi-level namespaces keep the existing REST client behavior (single-level only).

Which issue(s) this PR fixes:

Refs #7005 (related: #6499)

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

Unit: 33 new tests in iceberg_catalog/tests/test_polaris.py (HTTP mocked); ruff and mypy clean. In the existing iceberg_catalog tests, 7 fail identically on master and with this change: 2 DuckDB tests that patch get_catalog_client on a REST source, and 5 Spark tests that need pyspark.

Manual: ran against a local Apache Polaris (apache/polaris:latest) with MinIO: table discovery, DuckDB read with OAuth + vended credentials, feast apply with provider: polaris (properties verified by reloading the table through PyIceberg), get_historical_features, materialize + online read, feature view deletion, static-token mode, and bad credentials (sync returns False, no exception).

Misc

Docs are updated in docs/reference/data-sources/iceberg.md.

Add Polaris support on top of the Iceberg REST catalog integration:

- PolarisSource(IcebergSource): endpoint defaults to $POLARIS_HOST/api/catalog,
  OAuth2 client-credentials or bearer-token auth read from env vars (only
  names are stored in the registry), credential vending, and a discover()
  helper that builds sources for tables in a catalog.
- PolarisClient: OAuth client-credentials token acquisition with refresh, and
  table property updates through the standard Iceberg REST updateTable
  (set-properties / remove-properties).
- PolarisProvider: on feast apply, record feast.* table properties for feature
  views backed by a PolarisSource; deleted views are marked, tables are kept.
  Registered as provider "polaris".
- Centralize the PyIceberg REST catalog config in
  IcebergSource.get_pyiceberg_catalog_config()/load_pyiceberg_table() and use
  it from the DuckDB and Spark offline stores, replacing three duplicated
  copies. Behavior for existing IcebergSource users is unchanged.

Refs feast-dev#7005

Signed-off-by: hao-xu5 <hxu44@apple.com>
@haoxu0
haoxu0 requested a review from a team as a code owner October 13, 2026 18:49
"No Polaris credentials found: set %s and %s (OAuth client "
"credentials) or %s (bearer token)",
self.client_id_env_var,
self.client_secret_env_var,
@codecov-commenter

codecov-commenter commented Oct 13, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 21.52466% with 175 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.94%. Comparing base (2dfb9e6) to head (5ea289d).

Files with missing lines Patch % Lines
..._sources/contrib/iceberg_catalog/polaris_source.py 27.84% 57 Missing ⚠️
..._sources/contrib/iceberg_catalog/polaris_client.py 30.55% 50 Missing ⚠️
...ources/contrib/iceberg_catalog/polaris_provider.py 0.00% 50 Missing ⚠️
..._sources/contrib/iceberg_catalog/iceberg_source.py 11.76% 15 Missing ⚠️
sdk/python/feast/infra/offline_stores/duckdb.py 0.00% 2 Missing ⚠️
...ffline_stores/contrib/spark_offline_store/spark.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7006      +/-   ##
==========================================
- Coverage   51.02%   50.94%   -0.09%     
==========================================
  Files         452      455       +3     
  Lines       56728    56915     +187     
  Branches     8265     8290      +25     
==========================================
+ Hits        28946    28994      +48     
- Misses      25801    25940     +139     
  Partials     1981     1981              
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 52.40% <21.52%> (-0.10%) ⬇️
Files with missing lines Coverage Δ
...a/data_sources/contrib/iceberg_catalog/__init__.py 100.00% <100.00%> (ø)
sdk/python/feast/infra/provider.py 92.30% <ø> (ø)
...ffline_stores/contrib/spark_offline_store/spark.py 36.55% <0.00%> (+0.56%) ⬆️
sdk/python/feast/infra/offline_stores/duckdb.py 43.20% <0.00%> (+2.43%) ⬆️
..._sources/contrib/iceberg_catalog/iceberg_source.py 23.07% <11.76%> (-1.93%) ⬇️
..._sources/contrib/iceberg_catalog/polaris_client.py 30.55% <30.55%> (ø)
...ources/contrib/iceberg_catalog/polaris_provider.py 0.00% <0.00%> (ø)
..._sources/contrib/iceberg_catalog/polaris_source.py 27.84% <27.84%> (ø)

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 2dfb9e6...5ea289d. 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.

@haoxu0

haoxu0 commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@ntkathole PTAL, thanks!

Allowlist the env var names used as test fixtures (detect-secrets false positives) and stop logging credential env var names (CodeQL py/clear-text-logging-sensitive-data).

Signed-off-by: hao-xu5 <hxu44@apple.com>
@haoxu0
haoxu0 merged commit 386759c into feast-dev:master Oct 15, 2026
26 checks passed
@haoxu0
haoxu0 deleted the feat/polaris-source branch October 15, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants