You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select1as parent_id, 1as val
unionselect2as parent_id, 2as val
models/parent.sql
select1as id, 1as val
models/test.yml
models:
- name: childcolumns:
- name: parent_idtests:
- relationships:
to: ref('parent')field: id
- name: parentcolumns:
- name: id
Create the models: dbt run -m parent child
Expected behavior
Running dbt test -m child should error out, but it does not. Although, running dbt test -m parent child does error out.
Screenshots and log output
WARNING: Nothing to do. Try checking your model configs and model specification args
System information
Which database are you using dbt with?
postgres
redshift
bigquery
snowflake
other (specify: ____________)
The output of dbt --version:
installed version: 0.20.1
latest version: 0.20.2
Your version of dbt is out of date! You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
Plugins:
- bigquery: 0.20.1
- snowflake: 0.20.1
- redshift: 0.20.1
- postgres: 0.20.1
The operating system you're using:
macOS Big Sur | version 11.4
The output of python --version:
Python 3.8.8
The text was updated successfully, but these errors were encountered:
@leoch20 We made a change in dbt v0.20 around test selection that caught a few folks by surprise (#3496, #3571). I'd recommend you read #3571 (comment) for a quick summary.
To make a long story short, we believe that dbt test -m parent child should absolutely run the relationship test defined between them; but dbt test -m parent or dbt test -m child alone should not presume that you want to include a test with an unselected parent.
The mistake here, for which I take full responsibility, was the subtlety of this change, and the lack of transparency when a familiar command produced a suddenly unfamiliar result. To that end, dbt v0.21 will include better logging around which tests have been excluded because of an unselected parent, as well as an optional --greedy flag that lets you revert to the previous behavior of "greedier" test selection (#3723, #3833).
Describe the bug
The relationship test does not get triggered
Steps To Reproduce
models/child.sql
models/parent.sql
models/test.yml
Create the models:
dbt run -m parent child
Expected behavior
Running
dbt test -m child
should error out, but it does not. Although, runningdbt test -m parent child
does error out.Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
The output of
python --version
:The text was updated successfully, but these errors were encountered: