Skip to content

Shadow entities mapped properly to real entity with entity aliasing #1762

@mavysavydav

Description

@mavysavydav

Is your feature request related to a problem? Please describe.

There may be multiple different entity keys on the entity source data side that should map onto the same entity from the feature data table during the join. For instance, "spammer_id" and "reporter_id" may want the "years_on_platform" feature which lives in a table keyed by "user_id". It is inconvenient to combine the "spammer_ids" and "reporter_ids" into a new additional "user_ids" column and then clean it up after the join. In this case, we can call "spammer" and "reporter" the shadow entities of "user".

In another example, both "rider_id" and "driver_id" may want the "age" feature which lives in a table keyed by "user_id". In this case, we can call "rider" and "driver" the shadow entities of "user".

Describe the solution you'd like
A clear and concise description of what you want to happen.

Via aliasing on the FeatureServices level, the shadow entities can be mapped to the correct FeatureView entity.

abuse_feature_service = FeatureService(
    name="my_abuse_model_v1",
    features=[
        spammer_features,
        reporter_features,
        user_features.alias({'spammer_id', 'reporter_id'})
    ],
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions