Skip to content

Conversation

leiyangyou
Copy link
Contributor

Description

This fix addresses an issue where entity value types were incorrectly mapped when using feature views with join key aliases.

Problem

Previously, when using feature views with join key aliases (like in the example below), the entity_type_map would use the original column name instead of the aliased join key:

user_entity = Entity(
    name="user",
    join_keys=["user_id"],
    value_type=ValueType.INT32,
    description="User entity for the matching platform",
)

match_service = FeatureService(
    name="match_service",
    features=[
        user_profile_fv.with_name("user"),
        user_profile_fv.with_name("target_user").with_join_key_map(
            {"user_id": "target_user_id"}
        ),
    ],
)

This caused target_user_id to be interpreted as ValueType.INT64 instead of the correct entity value type (ValueType.INT32 in this case).

Solution

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.

Changes

  • Modified _get_entity_maps function in sdk/python/feast/utils.py
  • Added logic to check for join key aliases in the feature view projection
  • Map entity types to the correct aliased column names

Testing

This fix resolves the issue where aliased feature views would have incorrect entity value type mappings, ensuring that join keys maintain their correct data types even when aliased.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

This fix has been tested with the scenario described above where feature views are aliased with join key mappings. The entity value types are now correctly preserved for aliased join keys.

@leiyangyou leiyangyou requested a review from a team as a code owner July 1, 2025 19:46
@franciscojavierarceo
Copy link
Member

@leiyangyou can you. click the DCO?

@leiyangyou leiyangyou force-pushed the fix/entity-value-type-mapping-for-aliased-fv branch from 1cf98c2 to 979e918 Compare July 2, 2025 00:59
@leiyangyou
Copy link
Contributor Author

yeh it's passing now

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 <[email protected]>
@leiyangyou leiyangyou force-pushed the fix/entity-value-type-mapping-for-aliased-fv branch from 979e918 to 7e0c1f8 Compare July 2, 2025 02:33
@leiyangyou leiyangyou changed the title fix: correct entity value type mapping for aliased feature views fix: Correct entity value type mapping for aliased feature views Jul 2, 2025
Copy link
Contributor

@jyejare jyejare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration tests are failing !

@leiyangyou
Copy link
Contributor Author

it finally passed right, it's probably failing for other reasons

@franciscojavierarceo franciscojavierarceo merged commit bdf20bb into feast-dev:master Aug 1, 2025
16 of 18 checks passed
franciscojavierarceo pushed a commit that referenced this pull request Aug 14, 2025
# [0.52.0](v0.51.0...v0.52.0) (2025-08-14)

### Bug Fixes

* Correct entity value type mapping for aliased feature views ([#5492](#5492)) ([bdf20bb](bdf20bb))
* Correct namespace reference in remote Feast project setup for operator upgrade and previous version tests ([df391ec](df391ec))
* dell pydantic v1 ([1189512](1189512))
* Fixed the entity to on-demand feature view relationship ([1c59bba](1c59bba))
* Make transformers optional ([#5544](#5544)) ([a4eef38](a4eef38))
* Push Source inherits the timestamp fields from Data Source ([#5550](#5550)) ([b7ea5cc](b7ea5cc))
* Remove the devcontainer folder. ([a9815c2](a9815c2))

### Features

* Added API for discovering Feature Views by popular tags ([#5558](#5558)) ([2e5f564](2e5f564))
* Added filtering support for featureView and featureServices api ([#5552](#5552)) ([897b3f3](897b3f3))
* Added global search api and necessary unit tests ([#5532](#5532)) ([dd3061f](dd3061f))
* Added Ray Compute Engine and Ray Offline Store Support ([#5526](#5526)) ([72de088](72de088))
* Added recent visit logging api for registry server ([#5545](#5545)) ([2adcf2c](2adcf2c))
* **auth:** support client-credentials & static token for OIDC client auth ([fc44222](fc44222))
* **auth:** support client-credentials & static token for OIDC client auth ([795fc06](795fc06))
* Implement and enhance remote document retrieval functionality ([#5487](#5487)) ([d095b96](d095b96))
* Implemented consistent error handling ([7f10151](7f10151))
* Offline Store historical features retrieval without entity df, but based on datatime range ([#5527](#5527)) ([df942b9](df942b9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants