Generic test arguments property
The default value is now true. To preserve the previous behavior, set this flag to false in your dbt_project.yml.
| Loading table... |
dbt supports parsing key-value arguments that are inputs to generic tests when specified under the arguments property. In the past, dbt didn't support a way to clearly disambiguate between properties that were inputs to generic tests and framework configurations, and only accepted arguments as top-level properties.
If you are on an older Core version where the flag is false, dbt will recognize the arguments property but raise the ArgumentsPropertyInGenericTestDeprecation warning.
Here's an example using the new arguments property:
models:
- name: my_model_with_generic_test
data_tests:
- dbt_utils.expression_is_true:
arguments:
expression: "order_items_subtotal = subtotal"
Here's an example using the alternative test_name format:
models:
- name: my_model_with_generic_test
data_tests:
- name: arbitrary_name
test_name: dbt_utils.expression_is_true
arguments:
expression: "order_items_subtotal = subtotal"
config:
where: "1=1"
With this flag enabled, dbt will:
- Parse any key-value pairs under
argumentsin generic tests as inputs to the generic test macro. - Raise a
MissingArgumentsPropertyInGenericTestDeprecationwarning if additional non-config arguments are specified outside of theargumentsproperty.
To preserve the previous behavior:
flags:
require_generic_test_arguments_property: false
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.