calogica / dbt-expectations

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

Row condition is applied to both models #155

Closed armandduijn closed 2 years ago

armandduijn commented 2 years ago

Is there a reason why the row_condition is applied to both models? We're trying to use the expect_column_distinct_count_to_equal_other_table test with a row condition on one of the tables. But, in the current implementation, it applies the row condition to both models.

I think that if no compare_row_condition is provided, it shouldn't default to row_condition.

https://github.com/calogica/dbt-expectations/blob/af985a0cc5614202799ddbee7d4a5d784fa3f081/macros/schema_tests/_generalized/equal_expression.sql#L66

clausherther commented 2 years ago

Hi @armandduijn ! The intent here was that in most cases, you'll want parity across models to compare, hence the filter is applied to both by default. In your case, have you tried setting compare_row_condition to something like compare_row_condition: 1=1 to override it?