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
  • Tests: Added comprehensive tests for multi-entity feature views
  • 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

Testing

Added new test class TestDbtMultiEntitySupport with tests for:

  • Creating FeatureView with multiple entities
  • Code generation with multiple entities
  • Validation for empty entity_columns

Existing tests updated to use new entity_columns parameter.

Closes #5872

Add test dbt project with:
- Three feature models (driver, customer, product)
- Seed data for testing
- Schema definitions with proper tag configuration
- DuckDB profile for testing

Add pytest configuration:
- Isolated conftest to avoid heavy dependencies
- Auto-skip tests when manifest.json doesn't exist
- Custom pytest.ini for dbt test isolation

This infrastructure enables testing the dbt-to-Feast import workflow.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
Add 37 integration tests covering:

Manifest Parsing:
- Parse dbt metadata, models, columns, types
- Filter models by tag and name
- Extract model properties and dependencies

Feast Object Mapping:
- Create entities, data sources, feature views from dbt models
- Map dbt types to Feast types (int, float, string, etc.)
- Support BigQuery, Snowflake, and File data sources
- Handle timestamp fields and TTL configuration

Code Generation:
- Generate valid Python code for Feast objects
- Include proper imports and type definitions
- Support different data source types

Error Handling:
- Handle missing manifest files
- Validate JSON format
- Test unknown type fallbacks

Edge Cases:
- Parameterized types (VARCHAR(255), NUMBER(10,2))
- Array types, boolean types
- Custom timestamp fields
- Column exclusion

End-to-End Workflow:
- Complete dbt → Feast import flow
- Multiple models with different entities
- Tag-based filtering

Tests use dynamic values from dbt-generated manifests to ensure
real integration testing rather than static fixtures.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
Add CI workflow that:
1. Installs Python dependencies and Feast
2. Installs dbt-core and dbt-duckdb
3. Runs dbt build to generate manifest.json
4. Sets up Feast project with SQLite
5. Tests feast dbt import command
6. Verifies Feast objects were created
7. Runs pytest integration tests

Workflow runs on PRs that modify:
- dbt integration code (feast/dbt/**)
- dbt integration tests (tests/integration/dbt/**)
- The workflow file itself

Tests run on Python 3.11 and 3.12 to ensure compatibility.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>
@YassinNouh21 YassinNouh21 requested a review from a team as a code owner January 24, 2026 13:46
- Update CLI to accept multiple -e flags for entity columns
- Update mapper and codegen for multiple entities
- Add comprehensive tests for multi-entity feature views
- Update documentation with examples and usage
- Remove backward compatibility (feature is new)

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>
@YassinNouh21 YassinNouh21 force-pushed the feat/dbt-multi-entity-support-clean branch from 3670023 to 9165249 Compare January 24, 2026 13:47
@YassinNouh21
Copy link
Collaborator Author

Closing this PR - created a cleaner version without test infrastructure commits at #5901

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

1 participant