◐ Shell
clean mode source ↗

feat: Add integration tests for dbt import with local dbt project by Copilot · Pull Request #5877 · feast-dev/feast

What this PR does / why we need it:

Adds comprehensive integration tests for the dbt import feature (PR #5827), which previously lacked end-to-end testing with actual dbt project setup and Feast CLI integration.

Changes

Test Infrastructure

  • Created sdk/python/tests/integration/dbt/ with 600+ lines covering:
    • Manifest parsing with dbt-artifacts-parser
    • Tag filtering (feast, ml, recommendations)
    • Model selection by name
    • All 3 data source types (BigQuery, Snowflake, File)
    • Type mapping validation (INT32/64, FLOAT32/64, STRING, TIMESTAMP)
    • FeatureView generation with schema validation
    • Column exclusion (entity, timestamp, custom)
    • Code generation workflow

Test dbt Project

  • Minimal dbt project in test_dbt_project/ with 3 models:
    • driver_features: INT types, multiple tags
    • customer_features: STRING entity
    • product_features: FLOAT32, tag filtering test
  • Seed data (CSV files) for all three models to enable actual dbt execution
  • DuckDB-only profile configuration for local testing without external service dependencies
  • Models use ref() to reference seeds, enabling full dbt workflow testing
  • Manifest generation: Removed pre-committed manifest.json; CI now generates it via dbt build to ensure tests validate actual dbt output

CI/CD - End-to-End Workflow

  • GitHub Actions workflow dbt-integration-tests.yml
  • Runs on Python 3.11 & 3.12
  • Triggers on dbt code/test changes
  • Uses Makefile for dependency installation (make install-python-dependencies-ci)
  • Executes full dbt workflow: dbt deps, dbt build, dbt test with seed data
  • Tests Feast CLI integration:
    • Creates Feast project with SQLite online store configuration
    • Runs feast dbt import command with generated manifest
    • Verifies Feast objects (entities, feature views) are created correctly
  • Validates both dbt compilation and Feast import work together

Bug Fixes

  • Removed deprecated PytestUnhandledCoroutineWarning from pytest.ini
  • Fixed test failures by ensuring manifest.json is generated by dbt during CI rather than pre-committed

Test Example

def test_get_models_with_tag_filter(self, parser):
    """Test filtering models by dbt tag."""
    # Filter by 'ml' tag
    ml_models = parser.get_models(tag_filter="ml")
    assert len(ml_models) == 2
    
    # Filter by 'recommendations' tag
    rec_models = parser.get_models(tag_filter="recommendations")
    assert len(rec_models) == 1

Which issue(s) this PR fixes:

Related to #3335

Misc

Comprehensive documentation added for test structure and dbt project. The workflow now provides complete end-to-end testing from dbt model definition through to Feast feature store integration, including actual data materialization to SQLite online store. The manifest.json is dynamically generated during CI to ensure tests validate real dbt compilation output.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add integration tests for dbt import with local dbt project</issue_title>
<issue_description>## Context
PR #5827 added dbt integration but lacks proper integration tests with an actual dbt project setup.

Description

As mentioned by @franciscojavierarceo in PR #5827, we need a lightweight local dbt project that:

  • Sets up a minimal dbt project structure
  • Runs dbt compile to generate manifest.json
  • Tests the full feast dbt import workflow end-to-end
  • Validates generated Feast objects

Acceptance Criteria

  • Create test dbt project in sdk/python/tests/integration/dbt/
  • Add test that compiles dbt project and imports to Feast
  • Test all three data source types (bigquery, snowflake, file)
  • Verify FeatureViews are created correctly
  • Test tag filtering and model selection

Related

<agent_instructions>please setup dbt in a github action integration test and test the dbt parser that was implemented in PR #5827</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.