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
From v1.1.0 to v1.1.1 there was a change to at_least_one test´s code.
I think this change actually broke the way the test should work. The bug is in the logic for pruned_rows CTE.
Steps to reproduce
Let´s look at a simple table, say demo_table:
| col_1 | col_2 |
+-------+-------+
| A | 10 |
+-------+-------+
| B | null |
+-------+-------+
If we were to configure the at_least_one test for this table, using group_by_columns parameter, we would have the following:
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Describe the bug
From v1.1.0 to v1.1.1 there was a change to
at_least_one
test´s code.I think this change actually broke the way the test should work. The bug is in the logic for
pruned_rows
CTE.Steps to reproduce
Let´s look at a simple table, say
demo_table
:If we were to configure the
at_least_one
test for this table, usinggroup_by_columns
parameter, we would have the following:select_gb_cols = 'col_1'
groupby_gb_cols = 'group by col_1'
select_pruned_col = 'col_1, col_2'
Then, in
pruned_rows
CTE:The output of this CTE would be:
Continuing following the test's code, the following piece of logic would now be applied:
The output would be empty, as our only record in
pruned_rows
does have a non-null value forcol_2
.Expected results
I would expect this test to return the record with
col_1=B
, since for this value there are no non-null values incol_2
.Actual results
Explained above.
System information
dbt-labs/dbt_utils version 1.1.1
dbt version 1.6.3
bigquery plugin version 1.6.4
Which database are you using dbt with?
Are you interested in contributing the fix?
Can definitely provide more context if needed, but not interested in developing the code.
The text was updated successfully, but these errors were encountered: