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 #284

Merged

Conversation

JavierMonton
Copy link
Contributor

@JavierMonton JavierMonton commented Sep 25, 2020

This is a:

  • bug fix PR with no breaking changes (please change the base branch to main)
  • new functionality
  • a breaking change

Description & motivation

This is a new macro that will allow us to check not accepted values, exactly the opposite of accepted_values.
I'm already using it in a table with users and roles where I want to ensure that some roles are not inside that table.
This will close #283

Checklist

  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models (and macros if applicable)
  • I have added an entry to the changelog

I have a doubt about testing this kind of macros, writing a test that uses the macro only tests when it works, but not when it fails. Is there any way of testing when it fails?

Also, this is my first PR, I hope I did everything ok 🙂

@clrcrl clrcrl changed the base branch from master to dev/0.7.0 December 23, 2020 17:52
@clrcrl clrcrl force-pushed the schema_test/not_accepted_values branch from d198c6b to f60eebc Compare December 23, 2020 17:56
@clrcrl
Copy link
Contributor

clrcrl commented Dec 23, 2020

Just did a small rebase on your branch so that we don't have merge conflicts!

This is really great — I'm still thinking a little about the name here: is "not accepted" best, or is something like disallowed, or barred, better?

@JavierMonton
Copy link
Contributor Author

When I was looking for this functionality I was mainly searching for "not accepted values", but disallowed or rejected for example could be fine too! I would say that barred seems less familiar to me, but up to you!
I can change the name if you prefer.

@clrcrl
Copy link
Contributor

clrcrl commented Dec 23, 2020

The more I sat with it, the more I thought "not allowed" felt very descriptive, let's merge!

@clrcrl clrcrl merged commit 6bec09b into dbt-labs:dev/0.7.0 Dec 23, 2020
clrcrl pushed a commit that referenced this pull request May 18, 2021
Schema Test - Not accepted values, test fixed

empty lines at the end

Update changelog
clrcrl pushed a commit that referenced this pull request May 18, 2021
Schema Test - Not accepted values, test fixed

empty lines at the end

Update changelog
clrcrl pushed a commit that referenced this pull request May 18, 2021
Schema Test - Not accepted values, test fixed

empty lines at the end

Update changelog
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

Successfully merging this pull request may close these issues.

Schema Test - Not Accepted Values
2 participants