calogica / dbt-expectations

Port(ish) of Great Expectations to dbt test macros
https://calogica.github.io/dbt-expectations/
Apache License 2.0
989 stars 120 forks source link

[BUG] expect_multicolumn_sum_to_equal fails if sum_total is another column #290

Closed VDFaller closed 8 months ago

VDFaller commented 8 months ago

Is this a new bug in dbt-expectations?

Current Behavior

expect_multicolumn_sum_to_equal fails if sum_total is another column

if I have a source table like

      - name: test_counts
        tests:
          - dbt_expectations.expect_multicolumn_sum_to_equal:
              column_list: ["test_pass_count", "test_fail_count", "test_error_count", test_abort_count]
              sum_total: test_count #I can workaround by just doing sum(test_count)

Expected Behavior

I would expect it to not break

Steps To Reproduce

just put a different column in sum_total

Relevant log output

[MISSING_GROUP_BY] The query does not include a GROUP BY clause. Add GROUP BY or turn it into the window functions using OVER clauses.

Environment

- OS: windows 11
- Python: 3.9
- dbt: 1.6.6, dbt-databricks:1.6.6
- dbt-expectations: 0.8.5

Which database adapter are you using with dbt?

Note: dbt-expectations currently does not support database adapters other than the ones listed below.

Additional Context