Repository navigation
fix: Keep unmapped join keys in ibis point-in-time joins - #7159
Conversation
0538cd4 to
7162e5c
Compare
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7159 +/- ##
==========================================
+ Coverage 52.73% 52.74% +0.01%
==========================================
Files 459 459
Lines 58220 58220
Branches 8588 8587 -1
==========================================
+ Hits 30704 30711 +7
+ Misses 25414 25409 -5
+ Partials 2102 2100 -2
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
get_historical_features_ibis, used by the DuckDB offline store and the contrib Oracle and MSSQL stores, took a projection's join_key_map as the full list of join keys. When with_join_key_map renamed only some keys of a feature view with several entities, the other keys were left out of the join and of entity_row_id. Each entity row then got the latest value for the renamed key alone, taken from any value of the other keys. Build the map from the feature view's entity columns instead and keep the name of every key the projection does not rename, as the Dask and SQL offline stores and the online read path already do. Signed-off-by: Manoj Kumar Thapa <iammanoj807@gmail.com>
7162e5c to
9d696be
Compare
What this PR does / why we need it:
get_historical_features_ibis, which the DuckDB offline store and the contrib Oracle and MSSQL stores use, took a projection'sjoin_key_mapas the whole list of join keys whenever the map was not empty. Whenwith_join_key_maprenamed only some keys of a feature view with several entities, the other keys were left out of the point-in-time join predicates and ofentity_row_id. Each entity row then got the latest value for the renamed key alone, taken from any value of the other keys.Feature view keyed on
user_idandmerchant_id, used as.with_join_key_map({"user_id": "sender_id"}). User 1 spent 10 at merchant 100 and 99 at merchant 200:get_online_featureson the same store already returns 10 and 99.The map is now built from the feature view's entity columns, and every key the projection does not rename keeps its own name (
join_key_map.get(name, name)), as in the Dask store andoffline_utils.get_feature_view_query_context. The new_join_key_map()is used for both the join predicates andentity_row_id.Adds
test_get_historical_features_keeps_join_keys_left_out_of_join_key_maptotest_ibis.py. It fails on master ({100: 99, 200: 99}) and passes with this change.Which issue(s) this PR fixes:
Fixes #7158
Checks
git commit -s)Testing Strategy
Misc
Run locally:
test_ibis.py: 11 passed.test_feature_service.py,test_utils_entity_maps.pyandtest_unit_feature_store.py.test_offline_store.pywas not collected locally becausepsycopgis not installed.