fix(compute-engine/local): Honor field_mapping on join keys in dedup + join nodes#6395
Open
1fanwang wants to merge 2 commits into
Open
fix(compute-engine/local): Honor field_mapping on join keys in dedup + join nodes#63951fanwang wants to merge 2 commits into
1fanwang wants to merge 2 commits into
Conversation
When a batch source defines a `field_mapping` that renames an entity join key (e.g. `USERID` -> `user_id`), the source-read node renames the columns on the pulled Arrow table to their mapped names. Downstream `LocalDedupNode` and `LocalJoinNode` then look up the *pre-mapping* names from `column_info.join_keys`, which raises `KeyError: Index(['USERID'])` during materialization (or returns an empty join). Add a `join_keys_columns` property on `ColumnInfo` that mirrors the existing `timestamp_column` / `created_timestamp_column` properties — returning join keys translated through `field_mapping` — and use it from the dedup and join nodes. Fixes feast-dev#5942. Signed-off-by: 1fanwang <1fannnw@gmail.com>
Collaborator
|
LGTM |
HaoXuAI
approved these changes
May 12, 2026
Signed-off-by: 1fanwang <1fannnw@gmail.com>
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
Fixes #5942.
The bug isn't actually Snowflake-specific despite the issue title — it lives in the local compute engine's DAG nodes.
Path:
_get_column_names()returns the reverse-mapped join keys (e.g.["USERID"]).pull_latest_from_table_or_queryis called with those raw names — correct, the offline store needs them.LocalSourceReadNode.executerenames the result columns viafield_mapping.get(col, col)— the table now hasuser_id.LocalDedupNodeandLocalJoinNodethen look upcolumn_info.join_keys(still["USERID"]) on a df whose columns areuser_id. pandas raisesKeyError: Index(['USERID'], dtype='object')— the exact error in the issue.The existing
ColumnInfoclass already has mapped properties fortimestamp_columnandcreated_timestamp_column(precedent: PR #4886, which fixed the analogous bug forget_historical_features). This PR adds the missingjoin_keys_columnsmapped property and uses it inLocalDedupNodeandLocalJoinNode.How was this tested?
test_local_dedup_node_with_field_mapping_on_join_keyintests/unit/infra/compute_engines/local/test_nodes.py. Reproduces the exactKeyError(['USERID'])on master; passes with this PR.test_nodes.pystill pass.tests/unit/infra/compute_engines/still pass.ruff check,ruff format --check,mypyall clean.Scope
Local-engine only. The Spark, Ray, AWS Lambda, k8s, and Snowflake compute engines have the same
column_info.join_keyslookup pattern in their nodes and likely the same latent bug. Each is a separate <50 LoC follow-up — happy to file those if maintainers want them in this PR or as stacked.