Repository navigation
fix: Keep unmapped join keys in ibis point-in-time joins - #7159
Open
iammanoj807 wants to merge 1 commit into
Open
iammanoj807 wants to merge 1 commit into
iammanoj807 wants to merge 1 commit into
Conversation
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 <[email protected]>
This branch has not been deployed
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.