-
Notifications
You must be signed in to change notification settings - Fork 491
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 - Accepted Values for null value #287
Comments
Instead, you should use two separate tests:
|
In my case, I consider null is one of the accepted values.
If I only leave 0, 1, 99 in the accepted value list, I can see the test passes, so null seems one of the default accepted values?
…________________________________
From: Claire Carroll <notifications@github.com>
Sent: Wednesday, 30 September 2020, 23:06
To: fishtown-analytics/dbt-utils
Cc: ddppi; Author
Subject: Re: [fishtown-analytics/dbt-utils] Schema Test - Accepted Values for null value (#287)
Instead, you should use two separate tests:
version: 2
models:
- name: my_model
columns:
- name: id
tests:
- accepted_values:
values: [0, 1, 99]
- not_null
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#287 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6SDLSZPR3D6H7RNQ6GDK3SIMUMZANCNFSM4R6QFYRA>.
|
Hi @clrcrl , can you please let me know how to check accepted value of 0,1,99 and NULL? NULL is an acceptable value for me in this case, and I don't think your suggestion solves my issue. P.S. it seems NULL is a default accepted value. |
@clrcrl - I suppose the best way to do this is with a custom sql test such as
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, in one of my schema test, I want to test if the accepted values for a column is a list of numbers, or NULL, for example
models:
columns:
tests:
values: [0, 1, 99, null]
I find DBT tries to convert the value of the accepted values to characters, and also covert null to None. Then the test failed, because
Numeric value 'None' is not recognized
Is this an issue?
I am using Snowflake, Python 3.7 and DBT v0.18.0.
Thanks
The text was updated successfully, but these errors were encountered: