Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: Possible to used "+" syntax to apply tests to whole directories in dbt_project.yml? #209

Open
samLozier opened this issue Oct 20, 2022 · 1 comment

Comments

@samLozier
Copy link

I've been really liking this package, with the possible issue that I'm finding it a little tedious to repeat tests over and over again for each model in a project.

So far I haven't been able to figure out if it's possible to apply a test whole directory in a given project. For example, this would be a project-level sanity check test (currently not working):

#dbt_project.yml

models:
  +tests:
    - dbt_expectations.expect_table_row_count_to_be_between:
        min_value: 1 

Is there a slick way to do something like this, or will I need to write some kind of script to parse/edit yml files in bulk?

@clausherther
Copy link
Contributor

Thanks @samLozier! I hear you on this getting tedious quickly for large projects. Until dbt supports applying tests at the folder level, I think we're stuck with either copy/pasta or using/writing some sort of yaml generator.
I think that's a little out of scope for this repo. Is this something we should maybe talk to the https://github.com/dbt-labs/dbt-codegen folks about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants