From 7e0c1f8de0101c086d0ba1859e0d4e1dc36ec91d Mon Sep 17 00:00:00 2001 From: Lei Yang Date: Wed, 2 Jul 2025 03:38:57 +0800 Subject: [PATCH] fix: correct entity value type mapping for aliased feature views Fix issue where entity value types were incorrectly mapped when using feature views with join key aliases. Previously, the entity_type_map would use the original column name instead of the aliased join key, causing target_user_id to be interpreted as ValueType.INT64 instead of the correct entity value type. The fix ensures that when a feature view has a join key map, the entity type mapping uses the correct aliased column name from the projection's join_key_map. Signed-off-by: Lei Yang --- sdk/python/feast/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/python/feast/utils.py b/sdk/python/feast/utils.py index d8f075d16d4..b8f9c906173 100644 --- a/sdk/python/feast/utils.py +++ b/sdk/python/feast/utils.py @@ -693,8 +693,13 @@ def _get_entity_maps( entity.join_key, entity.join_key ) entity_name_to_join_key_map[entity_name] = join_key + for entity_column in feature_view.entity_columns: - entity_type_map[entity_column.name] = entity_column.dtype.to_value_type() + dtype = entity_column.dtype.to_value_type() + entity_join_key_column_name = feature_view.projection.join_key_map.get( + entity_column.name, entity_column.name + ) + entity_type_map[entity_join_key_column_name] = dtype return ( entity_name_to_join_key_map,