From 3668702c69e83e21f237e40727d745f399f5fcd9 Mon Sep 17 00:00:00 2001 From: sfc-gh-madkins <82121043+sfc-gh-madkins@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:48:29 -0500 Subject: [PATCH] fix: Fix field mapping logic during feature inference (#3067) fix: Fix bug where feature inference was improperly registering timestamp and created field if part of field_mapping Signed-off-by: Miles Adkins Signed-off-by: Miles Adkins --- sdk/python/feast/inference.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/python/feast/inference.py b/sdk/python/feast/inference.py index 011a3b99b2..1e3363d4bc 100644 --- a/sdk/python/feast/inference.py +++ b/sdk/python/feast/inference.py @@ -192,10 +192,10 @@ def _infer_features_and_entities( fv.batch_source.timestamp_field, fv.batch_source.created_timestamp_column, } - for column in columns_to_exclude: - if column in fv.batch_source.field_mapping: - columns_to_exclude.remove(column) - columns_to_exclude.add(fv.batch_source.field_mapping[column]) + for original_col, mapped_col in fv.batch_source.field_mapping.items(): + if mapped_col in columns_to_exclude: + columns_to_exclude.remove(mapped_col) + columns_to_exclude.add(original_col) table_column_names_and_types = fv.batch_source.get_table_column_names_and_types( config