dbt-labs / dbt-labs/dbt-audit-helper
Bug: compare_which_query_columns_differ passes wrong number of args to _get_comparison_bounds
- Dominant language
- No language data
- Stars
- 423
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
## Description
In `macros/compare_which_query_columns_differ.sql` line 8, the call to `_get_comparison_bounds` only passes `event_time`:
```sql
{% set event_time_props = audit_helper._get_comparison_bounds(event_time) %}
```
However, the macro signature in `macros/utils/_get_comparison_bounds.sql` requires 3 arguments:
```sql
{% macro _get_comparison_bounds(a_query, b_query, event_time) %}
```
This means any invocation of `compare_which_query_columns_differ` with `event_time` set will crash because `_get_comparison_bounds` receives only 1 argument instead of 3.
## Steps to reproduce
Call `compare_which_query_columns_differ` with a non-null `event_time` argument.
## Expected behavior
The macro should pass `a_query` and `b_query` (which are available in scope) along with `event_time` to `_get_comparison_bounds`.
## Fix
Change line 8 from:
```sql
{% set event_time_props = audit_helper._get_comparison_bounds(event_time) %}
```
to:
```sql
{% set event_time_props = audit_helper._get_comparison_bounds(a_query, b_query, event_time) %}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.