Skip to content

fix: Keep features whose name ends in _y in ibis point-in-time joins - #7166

Merged
ntkathole merged 2 commits into
feast-dev:masterfrom
iammanoj807:fix/ibis-y-suffix-feature-columns
Nov 18, 2026
Merged

ntkathole merged 2 commits into
feast-dev:masterfrom
iammanoj807:fix/ibis-y-suffix-feature-columns

Conversation

@iammanoj807

@iammanoj807 iammanoj807 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

point_in_time_join in ibis.py is used by get_historical_features on the DuckDB offline store and the contrib Oracle and MSSQL stores. It joins the feature data with the entity data using rname="{name}_y", then dropped every column whose name ends in _y. That drop was meant for the copies the join makes of entity columns that clash with feature-table columns. It also removed:

  • features named like pos_y, or y with full_feature_names=True, so the select that follows failed with Column 'pos_y' is not found in table;
  • batch source timestamp and created columns ending in _y, which failed the same way.

A source column named after a join key or the timestamp column plus _y (e.g. event_timestamp_y) failed earlier, with IntegrityError: Name collisions, even when it was not requested.

The join is now followed by a select of entity_row_id from the entity table and the timestamp, created and feature columns from the feature table, so nothing is dropped by name. #5847 did the same for the _yyyy copies after the second join.

Adds two tests to test_ibis.py. Both fail on master and pass with this change:

  • test_point_in_time_join_keeps_features_whose_name_ends_in_y. On master: Column 'pos_y' is not found in table.
  • test_point_in_time_join_allows_columns_named_like_the_y_copies. On master: Name collisions. This test also fails if the suffix drop is simply deleted, because the join's _y copies then clash with those columns.

Also adds test_historical_features_with_names_ending_in_y to the universal historical retrieval tests. It requests pos_x, pos_y and y through FeatureStore.get_historical_features from a source whose timestamp and created columns are ts_y and created_y, with and without full feature names, and checks the latest eligible values. Without the fix it fails on DuckDB with Column 'ts_y' is not found in table (or Column 'pos_y' is not found in table when the timestamp columns have plain names), and it passes on the file store.

Which issue(s) this PR fixes:

Fixes #7165

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

Run locally:

  • test_ibis.py: 12 passed.

  • Offline store unit tests (plus test_lance_source.py and test_compute_correctness.py): 163 passed, which is master's results plus the two new tests.

    • The same 2 Spark monitoring tests fail on master.
    • test_clickhouse.py and test_offline_store.py are not collected locally (optional dependencies).
  • File and DuckDB universal offline store integration tests (sdk/python/tests/integration/offline_store), with this branch merged into current master: 95 passed and 5 skipped, which is master's results plus the 4 new test cases. The same 3 non-entity-mode tests fail on master, test_dqm_validation.py is not collected locally, and the Delta source was left out because deltalake is not installed locally.

  • ruff 0.16.10 and mypy 1.11.2 pass on the changed files.

  • Manual check: the reproducer from the issue.

  • Randomised comparison against master and a brute-force point-in-time reference. 5,300 get_historical_features calls on DuckDB through a FeatureStore with registered feature services, covering:

    • 1–4 feature views per call;
    • features, timestamps, created columns, join keys and extra entity columns named with and without _y;
    • TTL, full_feature_names, renamed join keys, null keys and duplicate entity rows.

    This branch matched the reference on every value.

    3,600 of the calls were compared against master. It failed on 2,228, and the other 1,372 gave frames identical to this branch. Those 1,372 include all 1,200 calls with no _y name.

    The other 1,700 calls ran with fix: Keep unmapped join keys in ibis point-in-time joins #7159 applied as well, and also matched the reference on every value.

  • The Oracle and MSSQL TTL path (event_expire_timestamp_fn, which turns the feature table into a SQL expression): checked with DuckDB 1.5. It gives the same rows as master, and returns pos_y.


Devin Review

@iammanoj807
iammanoj807 requested a review from a team as a code owner November 16, 2026 09:27

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

Devin Review

Comment on lines +522 to 525
).select(
entity_table["entity_row_id"],
*[feature_table[c] for c in dict.fromkeys(kept_columns)],
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Missing required universal retrieval regression

The point_in_time_join change adds only unit coverage, omitting the required universal integration regression. The component testing rule requires a universal test whenever retrieval behavior changes.

Learn more

The new tests exercise the Ibis helper directly, while historical retrieval also performs feature-name rewriting and source-column preparation in get_historical_features_ibis. The component testing requirement explicitly requires a universal integration test for retrieval changes. The diff adds no integration tests.

Example: A universal retrieval test requests a feature named pos_y through FeatureStore.get_historical_features and verifies its latest eligible value, including when full feature names are enabled.

Recommended fix: Add a regression case to the universal offline-store integration suite using the existing store fixtures. Exercise suffix-bearing feature names through the public retrieval API rather than only calling the Ibis helper.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in c50c099: test_historical_features_with_names_ending_in_y in the universal historical retrieval tests requests pos_x, pos_y and y through FeatureStore.get_historical_features, from a source whose timestamp and created columns are ts_y and created_y, with and without full feature names. Without the fix it fails on DuckDB (Column 'ts_y' is not found in table, or Column 'pos_y' is not found in table when the timestamp columns have plain names); with it, it passes on the file and DuckDB stores.

@codecov-commenter

codecov-commenter commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.63%. Comparing base (2a312cc) to head (f9bbe6c).
⚠️ Report is 4 commits behind head on master.
❗ 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    #7166      +/-   ##
==========================================
+ Coverage   53.35%   53.63%   +0.28%     
==========================================
  Files         462      462              
  Lines       58534    58537       +3     
  Branches     8632     8632              
==========================================
+ Hits        31230    31397     +167     
+ Misses      25180    25005     -175     
- Partials     2124     2135      +11     
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 55.21% <100.00%> (+0.30%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/infra/offline_stores/ibis.py 69.91% <100.00%> (+0.26%) ⬆️

... and 6 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 4782ba3...f9bbe6c. 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.

point_in_time_join, used by get_historical_features on the DuckDB offline
store and the contrib Oracle and MSSQL stores, dropped every column whose
name ends in "_y" after joining the feature data with the entity data. The
drop was meant for the "_y" copies the join makes of entity columns that
clash with feature-table columns, but it also removed a feature named like
"pos_y" (or "y" with full_feature_names=True), and the select that followed
failed with "Column 'pos_y' is not found in table". Timestamp and created
columns ending in "_y" failed the same way, and a feature-table column
named like one of the copies (e.g. "event_timestamp_y") failed with
"Name collisions" even when it was not requested.

Select entity_row_id and the timestamp, created and feature columns from
their own tables instead, so that no column has to be dropped by name.

Signed-off-by: Manoj Kumar Thapa <iammanoj807@gmail.com>
Request pos_x, pos_y and y through FeatureStore.get_historical_features
from a source whose timestamp and created columns are ts_y and created_y,
with and without full feature names, and check the latest eligible values.

Signed-off-by: Manoj Kumar Thapa <iammanoj807@gmail.com>
@ntkathole
ntkathole force-pushed the fix/ibis-y-suffix-feature-columns branch from c50c099 to f9bbe6c Compare November 18, 2026 12:01
@ntkathole
ntkathole merged commit cf013eb into feast-dev:master Nov 18, 2026
17 of 22 checks passed
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.

get_historical_features on DuckDB fails for features whose name ends in "_y"

4 participants