-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Add multiple entity support to dbt integration #5901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
franciscojavierarceo
merged 3 commits into
feast-dev:master
from
YassinNouh21:feat/dbt-multi-entity-clean-v2
Jan 26, 2026
Merged
feat: Add multiple entity support to dbt integration #5901
franciscojavierarceo
merged 3 commits into
feast-dev:master
from
YassinNouh21:feat/dbt-multi-entity-clean-v2
Jan 26, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 <yassinnouh21@gmail.com>
c2f9175 to
b187b6d
Compare
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 <yassinnouh21@gmail.com>
b187b6d to
407cffc
Compare
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 <yassinnouh21@gmail.com>
franciscojavierarceo
approved these changes
Jan 26, 2026
Member
|
Nice! |
YassinNouh21
added a commit
to YassinNouh21/feast
that referenced
this pull request
Feb 7, 2026
* feat: Add multiple entity support to dbt integration - 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 <yassinnouh21@gmail.com> * fix: Infer entity value types from dbt column types 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 <yassinnouh21@gmail.com> * fix: Update unit tests for multi-entity parameter changes 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 <yassinnouh21@gmail.com> --------- Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
YassinNouh21
added a commit
to YassinNouh21/feast
that referenced
this pull request
Feb 7, 2026
* feat: Add multiple entity support to dbt integration - 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 <yassinnouh21@gmail.com> * fix: Infer entity value types from dbt column types 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 <yassinnouh21@gmail.com> * fix: Update unit tests for multi-entity parameter changes 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 <yassinnouh21@gmail.com> --------- Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for multiple entities per FeatureView in the dbt integration, enabling use cases like transaction features keyed by both
user_idandmerchant_id.Changes
--entity-columnoption to accept multiple-eflagscreate_feature_view()to handle multiple entity columnsUsage
Single entity:
Multiple entities:
Implementation Notes
Base
This PR builds on top of #5827 (dbt integration base feature).
Closes #5872