fix: add ephemeral wrappers so schema tests run in both dbt Core and Fusion#571
Merged
Merged
Conversation
…d Fusion
Previously, generic tests in dbt_project_evaluator_schema_tests/*.yml were
silently dropped by Fusion (dbt1005: Unused schema.yml entry) because the
referenced models belonged to the package, not the local project. The tests
also emitted MissingArgumentsPropertyInGenericTestDeprecation in dbt-core 1.11+.
- Add _dpe ephemeral wrapper models (select * from ref('dbt_project_evaluator', '...'))
for each package model tested in core.yml, graph.yml, and tests.yml
- Nest generic test arguments under arguments: to fix the deprecation warning
- Add /dbt_project_evaluator_schema_tests/ to exclude_paths_from_project so
the wrapper models are not analyzed by the package itself
- Restrict on_schema_change not_null test to incremental models only, since
Fusion sets on_schema_change=null for non-incremental models (Core uses 'ignore')
- Update BigQuery disable config to reference the renamed test node
- Enable require_ref_prefers_node_package_to_root flag to prevent package
models from accidentally resolving refs to root project models
Collaborator
Author
|
Closes #569 |
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
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
dbt_project_evaluator_schema_tests/*.ymlreferenced package models directly. Fusion treated these as unused entries (dbt1005) and silently dropped all tests. dbt-core 1.11+ emittedMissingArgumentsPropertyInGenericTestDeprecationfor tests withoutarguments:nesting (the project also opts in viarequire_generic_test_arguments_property: True)._dpewrapper models (select * from {{ ref('dbt_project_evaluator', '...') }}) — one per package model tested in the YAML files. Fusion recognizes these as local models and runs their tests.arguments:nesting forexpression_is_true,unique_combination_of_columns, and twoaccepted_valuestests to clear the deprecation warning./dbt_project_evaluator_schema_tests/toexclude_paths_from_projectso the wrapper models are not analyzed by the package itself (prevents metric drift in equality tests).require_ref_prefers_node_package_to_rootflag so package-internalref()calls resolve to the package's own models, not the root project wrappers.on_schema_changenot-null test tomaterialized = 'incremental'— Fusion setson_schema_change = nullfor non-incremental models while Core defaults to'ignore'.unique_int_all_dag_relationships_dpe_path).Test plan
fs parse— nodbt1005: Unused schema.yml entrywarningsdbt parse— noMissingArgumentsPropertyInGenericTestDeprecationwarningsfs list --select test_type:generic— all wrapper model tests visible in Fusionfs build --static-analysis=off --full-refresh --vars '{"deactivate_for_fusion": true}'passes on DuckDB