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 13 forks source link

[Bug] `dbt_project.yml` needs Components specified as a `issue_field_history_columns` vars if customer is using components #83

Closed fivetran-avinash closed 1 year ago

fivetran-avinash commented 1 year ago

Is there an existing issue for this?

Describe the issue

We recently introduced new logic into jira__daily_issue_field_history that accounts for pulling components data directly into our model to avoid any overlap with field_option. However, this is currently throwing an error because we did not add the necessary variable logic in dbt_project.yml for when it isn't present inside issue_field_history.

Adding

vars:
     jira:
      issue_field_history_columns:
          - "Components" 

is necessary.

However, we will want this logic to compile only if the customer is using the components table. We might recommend using {% if var('jira_using_components', True) %} above issue_field_history_columns since we wouldn't want to call it if components wasn't a part of the model. See examples in the newest version of jira__daily_issue_field_history.

Relevant error log or model output

00:11:01  Database Error in model jira__daily_issue_field_history (models/jira__daily_issue_field_history.sql)
00:11:01    Name components not found inside joined at [101:65]
00:11:01    compiled Code at target/run/jira/models/jira__daily_issue_field_history.sql

Expected behavior

The models should compile but it is not finding the components column inside daily_issue_field_history if it is not set as a field.

dbt Project configurations

vars:
     jira:
      issue_field_history_columns:
          - "Components" 

Package versions

jira 0.12.1

What database are you using dbt with?

bigquery

dbt Version

dbt=1.3.0

Additional Context

No response

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

fivetran-joemarkiewicz commented 1 year ago

Thanks for opening this issue @fivetran-avinash.

As you mentioned in the issue description, I believe replacing the following lines with the same for/conditional logic that you used here should resolve the issue and ensure the logic only runs if customers have included components in their issue_file_history_columns variable:

fivetran-joemarkiewicz commented 1 year ago

This has been addressed in the merged rollback linked above. As such, I will close this issue.