fivetran / dbt_jira

Data models for Fivetran's Jira connector built using dbt.
https://fivetran.github.io/dbt_jira/
Apache License 2.0
8 stars 15 forks source link

[Bug] Column names flipped in int_jira__user_metrics #65

Closed fivetran-catfritz closed 2 years ago

fivetran-catfritz commented 2 years ago

Is there an existing issue for this?

Describe the issue

Lines 42 & 43 of int_jira__user_metrics to be revisited as the column alias names appear to be flipped. While the code still runs, this creates an issue down the line with the columns output by jira__user_enhanced.sql, specifically avg_age_currently_open_seconds and avg_close_time_seconds.

Relevant error log or model output

Before: Below is the output when the model is run as it stands. When looking at output, it is most easily observable in rows where the count is 0 in one column and not 0 in the other. For example in row 2, the count_closed... = 1, however the value for avg_close_time_seconds is null, however, we would expect this to be a non-zero value. Further, in this row, we would expect the average to equal the median since there is only 1 closed task. See also rows 3 and 6 for similar issues.

Screen Shot 2022-09-20 at 3 02 35 PM

After: After switching the variable names, we get the expected outcome. The value is not null, and the average is the same as the median.

Screen Shot 2022-09-20 at 3 06 58 PM

Expected behavior

Code is updated.

dbt Project configurations

n/a

Package versions

0.8.2

What database are you using dbt with?

bigquery

dbt Version

1.2.0

Additional Context

No response

Are you willing to open a PR to help address this issue?