How can I exclude a dbt singular test from running...
# ask-ai
b
How can I exclude a dbt singular test from running when materialising a dbt asset?
s
To exclude a dbt singular test from running when materializing a dbt asset, you can use the
exclude
parameter in the
@dbt_assets
decorator. This parameter allows you to specify a dbt selection string for the models in a project that you want to exclude. According to the documentation, the
exclude
parameter accepts a dbt selection string that defaults to an empty string if not specified. Here's an example from the documentation on how you might use the
exclude
parameter:
Copy code
python @dbt_assets(manifest=manifest, exclude="tag:long_running_test") def my_dbt_assets(context: AssetExecutionContext, dbt: DbtCliResource):     yield from dbt.cli(["build"], context=context).stream()
In this example, the
exclude
parameter is set to
"tag:long_running_test"
, which would exclude any dbt tests tagged with
long_running_test
from being run during the materialization process. Please note that the exact string you use in the
exclude
parameter will depend on how you've tagged or named the tests in your dbt project. You'll need to adjust the selection string to match the specific tests you want to exclude.
125 Views