Search code examples
snowflake-cloud-data-platformdbt

What does '--data' mean in the dbt test command?


A few of our automated pipelines have been using the below dbt test command for a long time.

dbt test --target target_name --data --m test_file_name --vars "{'branch':'branch_name','execdate':'2020/01/01'}" --no-version-check

It worked without trouble until the dbt version was upgraded from 0.17.0 to 1.0.0.

Now, getting an error as,

dbt: error: unrecognized arguments: --data

I can remove the --data from the dbt command now but I am curious to know why the people have added --data in the dbt command during the pipeline development long back and what it is doing in the dbt command?

Any help, please?


Solution

  • This part is described: Test selection examples:

    Through the combination of direct and indirect selection, there are many ways to accomplish the same outcome. Let's say we have a data test named assert_total_payment_amount_is_positive that depends on a model named payments. All of the following would manage to select and execute that test specifically:

    $ dbt test --select assert_total_payment_amount_is_positive # directly select the test by name

    $ dbt test --select payments,test_type:data # indirect selection, v0.18.0

    $ dbt test --select payments --data # indirect selection, earlier versions

    Syntax --data was supported in version lower than v.0.18.0.