Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@YassinNouh21
Copy link
Collaborator

Summary

Adds support for multiple entities per FeatureView in the dbt integration, enabling use cases like transaction features keyed by both user_id and merchant_id.

Changes

  • CLI: Updated --entity-column option to accept multiple -e flags
  • Mapper: Modified create_feature_view() to handle multiple entity columns
  • Code Generator: Updated to generate code with multiple entities
  • Documentation: Updated with examples and usage guidelines

Usage

Single entity:

feast dbt import -m manifest.json -e driver_id --tag feast

Multiple entities:

feast dbt import -m manifest.json -e user_id -e merchant_id --tag feast

Implementation Notes

  • Clean implementation without backward compatibility (dbt integration is new)
  • Validation for duplicate entity columns
  • All entity columns must exist in each model being imported

Base

This PR builds on top of #5827 (dbt integration base feature).

Closes #5872

- Update CLI to accept multiple -e flags for entity columns
- Update mapper and codegen for multiple entities
- Update documentation with examples and usage

This extends the dbt integration to support FeatureViews with
multiple entities, enabling use cases like transaction features
keyed by both user_id and merchant_id.

Fixes feast-dev#5872

Signed-off-by: yassinnouh21 <[email protected]>
@YassinNouh21 YassinNouh21 requested a review from a team as a code owner January 24, 2026 13:59
@YassinNouh21 YassinNouh21 force-pushed the feat/dbt-multi-entity-clean-v2 branch from c2f9175 to b187b6d Compare January 24, 2026 14:45
When creating entities from dbt models with integer columns, entities were
being created with default ValueType.STRING, causing validation errors:
"Entity X has type ValueType.STRING, which does not match the inferred type Int64"

Solution: Added mapping dict and helper function for clean type conversion:
- FEAST_TYPE_TO_VALUE_TYPE: Maps FeastType to ValueType
- feast_type_to_value_type(): Helper function for conversion
- _infer_entity_value_type(): Method in DbtToFeastMapper class

This replaces verbose if-else chains with a clean dictionary lookup pattern.

Also corrects schema generation to include entity columns, as FeatureView.__init__
expects to extract entity columns from the schema itself (lines 216-234 in
feature_view.py).

Changes:
- feast/cli/dbt_import.py: Use mapper's _infer_entity_value_type() method
- feast/dbt/mapper.py: Add type mapping dict and helper method

Signed-off-by: yassinnouh21 <[email protected]>
@YassinNouh21 YassinNouh21 force-pushed the feat/dbt-multi-entity-clean-v2 branch from b187b6d to 407cffc Compare January 24, 2026 15:03
Updated test_mapper.py to use new parameter names:
- entity_column -> entity_columns (accepts both str and List[str])
- result["entity"] -> result["entities"] (now returns list)

Tests now correctly check for list of entities returned by
create_all_from_model().

Signed-off-by: yassinnouh21 <[email protected]>
@franciscojavierarceo
Copy link
Member

Nice!

@franciscojavierarceo franciscojavierarceo merged commit 05a4fb5 into feast-dev:master Jan 26, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbt integration: Support multiple entities per FeatureView

2 participants