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

Schema Test - Not Accepted Values #283

Closed
JavierMonton opened this issue Sep 25, 2020 · 0 comments · Fixed by #284
Closed

Schema Test - Not Accepted Values #283

JavierMonton opened this issue Sep 25, 2020 · 0 comments · Fixed by #284
Labels
enhancement New feature or request triage

Comments

@JavierMonton
Copy link
Contributor

JavierMonton commented Sep 25, 2020

Describe the feature

Exactly the opposite of accepted_values test.
A way to test if a value is not inside a field.

Describe alternatives you've considered

Using dbt_utils.expression_is_true could be achieved but it is harder if you have several values and doing a macro that works in a column level could be useful

Additional context

It should work with any kind of database

Who will this benefit?

Anyone that wants to check if specific values are not inside a column.
Some examples:

  • A table with users and their roles where I want to ensure that there are no "public" roles.
  • A table with some cities, I want to check if some cities are not there

Are you interested in contributing to this feature?

Yes, I would be more than happy to help by creating a PR with this.

My main doubt creating a PR is related to tests, I think I did one test correctly but I would like to do the test where the feature actually fails. Maybe that can be discussed better in a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant