-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Bug] test not_null: error_if not working #4051
Comments
@pato0301 Thanks for the bug report! This does indeed seem to be a regression. dbt is doing something very weird: version: 2
models:
- name: my_model
columns:
- name: id
tests:
- not_null:
error_if: '>1' Then in
I'll do some more digging and try to figure out where this is happening |
This should be a simple one :) dbt-core/core/dbt/parser/generic_test_builders.py Lines 360 to 361 in 79aa136
That should read: config['error_if'] = self.error_if It also looks like Let's add a test for this! |
Do you have an ETA of fix this error? thanks in advance and regards! |
@willycerezo This fix will be included in v0.21.1 and v1.0.0. Both are currently available as release candidates:
We're likely to have a final version of v0.21.1 in the next week. The final v1 release will be in early December. |
Is there an existing issue for this?
Current Behavior
I have a test within a model that has the following syntax:
description: description
tests:
- error_if: '>1'
This test was working okay in the 0.20 version but when I upgraded to the 0.21 version when I run
dbt test
it fails with the following error:Got 1 result, configured to fail if != 0
Expected Behavior
The expected behaviour is that the test only fails when there is more than one null value in the model, that is to say, that the test allows only one null value.
Steps To Reproduce
not_null
error_if: '>1'
to that testdbt test
Relevant log output
Environment
What database are you using dbt with?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: