Repository navigation
fix: Keep features whose name ends in _y in ibis point-in-time joins - #7166
Conversation
| ).select( | ||
| entity_table["entity_row_id"], | ||
| *[feature_table[c] for c in dict.fromkeys(kept_columns)], | ||
| ) |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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>
c50c099 to
f9bbe6c
Compare
What this PR does / why we need it:
point_in_time_joininibis.pyis used byget_historical_featureson the DuckDB offline store and the contrib Oracle and MSSQL stores. It joins the feature data with the entity data usingrname="{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:pos_y, orywithfull_feature_names=True, so the select that follows failed withColumn 'pos_y' is not found in table;_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, withIntegrityError: Name collisions, even when it was not requested.The join is now followed by a select of
entity_row_idfrom 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_yyyycopies 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_ycopies then clash with those columns.Also adds
test_historical_features_with_names_ending_in_yto the universal historical retrieval tests. It requestspos_x,pos_yandythroughFeatureStore.get_historical_featuresfrom a source whose timestamp and created columns arets_yandcreated_y, with and without full feature names, and checks the latest eligible values. Without the fix it fails on DuckDB withColumn 'ts_y' is not found in table(orColumn 'pos_y' is not found in tablewhen the timestamp columns have plain names), and it passes on the file store.Which issue(s) this PR fixes:
Fixes #7165
Checks
git commit -s)Testing Strategy
Misc
Run locally:
test_ibis.py: 12 passed.Offline store unit tests (plus
test_lance_source.pyandtest_compute_correctness.py): 163 passed, which is master's results plus the two new tests.test_clickhouse.pyandtest_offline_store.pyare 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.pyis not collected locally, and the Delta source was left out becausedeltalakeis 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_featurescalls on DuckDB through aFeatureStorewith registered feature services, covering:_y;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
_yname.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 returnspos_y.