You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and we have following table data, which fails the test.
id
sample_column
1
x
2
y
3
In this case, dbt show -s not_null_sample_table_sample_column command shows the failure of sample_column with invalid sample_column value "null".
But we cannot get the information of the id column that fails from dbt show . We have to query again to find which row is wrong.
Is this your first time submitting a feature request?
Describe the feature
We have
not_null
generic test that checks a column that must not have null value.dbt-adapters/dbt/include/global_project/macros/generic_test_sql/not_null.sql
Lines 1 to 9 in 2a99e36
Using it without
--store_failures
option,dbt show -s [test_name]
will show the null column name with its value "null".For example we have a table definition:
and we have following table data, which fails the test.
In this case,
dbt show -s not_null_sample_table_sample_column
command shows the failure of sample_column with invalid sample_column value "null".But we cannot get the information of the id column that fails from
dbt show
. We have to query again to find which row is wrong.I thought it will be good to SELECT reference column together when testing
not_null
.The output will look something like this:
Describe alternatives you've considered
Declaring the following generic test by my own repository also solves the problem.
But I thought it will be good to place it in dbt-labs/dbt-adapters repository.
Who will this benefit?
dbt test
command users that usenot_null
generic test but don't use--store_failures
optionAre you interested in contributing this feature?
Yes
Anything else?
If I get some 👍 s to this issue, I'd like to add the SQL macro into this repository.
The text was updated successfully, but these errors were encountered: