[Bug] dbt build : run tests on selected model with tags #11325
Labels
bug
Something isn't working
dbt tests
Issues related to built-in dbt testing functionality
node selection
Functionality and syntax for selecting DAG nodes
triage
Is this a new bug in dbt-core?
Current Behavior
Hi,
I would like to build a dbt model + tests according to the tags I have defined for each tests
For example I have a model:
Here I want to run the model + the test "not_null" on the column "customer_id" only when I run the model on the target "staging"
But it seems that tags are herited from the model.
When I run the following command, it runs the model + all the tests (not only the ones with the tag "staging")
The test unique_orders_order_id is executed event it don't have the staging tag.
Is there a way to run only the tests with the selected tags on s selected model ?
If I run
dbt build -t staging --select "orders tags:staging"
it will execute eveything that have the tag staging.If I remove the tags on on model config, nothing is executed.
Thanks
Expected Behavior
Only the tests having the selected tag:staging are executed.
Steps To Reproduce
Create a model with 2 tags, and tests with only one tag like in the description ⬆
Relevant log output
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: