You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+6
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
# dbt_jira v0.15.0
2
+
[PR #108](https://github.com/fivetran/dbt_jira/pull/108) contains the following updates:
3
+
## 🚨 Breaking Changes 🚨
4
+
- Updated the `jira__daily_issue_field_history` model to make sure `issue_type` values are correctly joined into the downstream issue models. This applied only if `issue type` is leveraged within the `issue_field_history_columns` variable.
5
+
>**Note**: Please be aware that a `dbt run --full-refresh` will be required after upgrading to this version in order to capture the updates.
6
+
1
7
# dbt_jira v0.14.0
2
8
## 🚨 Breaking Changes 🚨
3
9
- Fixed the `jira__daily_issue_field_history` model to make sure `component` values are correctly joined into the downstream issue models. This applied only if `components` are leveraged within the `issue_field_history_columns` variable. ([PR #99](https://github.com/fivetran/dbt_jira/pull/99))
{% for col in pivot_data_columns if col.name|lower=='components'and var('jira_using_components', True) %}
85
-
, pivoted_daily_history.components
86
-
{% endfor %}
87
-
{% for col in pivot_data_columns if col.name|lower not in ['issue_day_id','issue_id','valid_starting_on','components'] %}
88
-
, {{ col.name }}
92
+
{% for col in pivot_data_columns %}
93
+
{% if col.name|lower=='components'and var('jira_using_components', True) %}
94
+
, pivoted_daily_history.components
95
+
96
+
{% elif col.name|lower not in ['issue_day_id', 'issue_id', 'valid_starting_on', 'components'] %}
97
+
, pivoted_daily_history.{{ col.name }}
98
+
99
+
{% endif %}
89
100
{% endfor %}
90
101
{% endif %}
91
102
@@ -102,36 +113,50 @@ joined as (
102
113
),
103
114
104
115
set_values as (
105
-
106
116
select
107
117
date_day,
108
118
issue_id,
109
119
joined.status_id,
110
120
sum( case when joined.status_id is null then 0 else 1 end) over ( partition by issue_id
111
121
order by date_day rows unbounded preceding) as status_id_field_partition
112
122
113
-
{% for col in pivot_data_columns if col.name|lower=='components'and var('jira_using_components', True) %}
114
-
, coalesce(components.component_name, joined.components) as components
115
-
, sum(case when joined.components is null then 0 else 1 end) over (partition by issue_id order by date_day rows unbounded preceding) as component_field_partition
-- create a batch/partition once a new value is provided
121
-
, sum( case when {{ col.name }} is null then 0 else 1 end) over ( partition by issue_id
122
-
order by date_day rows unbounded preceding) as {{ col.name }}_field_partition
126
+
{% for col in pivot_data_columns %}
127
+
{% if col.name|lower=='components'and var('jira_using_components', True) %}
128
+
, coalesce(components.component_name, joined.components) as components
129
+
, sum(case when joined.components is null then 0 else 1 end) over (partition by issue_id order by date_day rows unbounded preceding) as component_field_partition
130
+
131
+
{% elif col.name|lower=='issue_type' %}
132
+
, coalesce(issue_types.issue_type_name, joined.issue_type) as issue_type
133
+
, sum(case when joined.issue_type is null then 0 else 1 end) over (partition by issue_id order by date_day rows unbounded preceding) as issue_type_field_partition
-- create a batch/partition once a new value is provided
138
+
, sum( case when joined.{{ col.name }} is null then 0 else 1 end) over ( partition by issue_id
139
+
order by date_day rows unbounded preceding) as {{ col.name }}_field_partition
140
+
141
+
{% endif %}
123
142
{% endfor %}
124
143
125
144
from joined
126
145
127
-
{% for col in pivot_data_columns if col.name|lower=='components'and var('jira_using_components', True) %}
128
-
left join components
129
-
on cast(components.component_idas {{ dbt.type_string() }}) =joined.components
130
-
{% endfor %}
146
+
{% for col in pivot_data_columns %}
147
+
{% if col.name|lower=='components'and var('jira_using_components', True) %}
148
+
left join components
149
+
on cast(components.component_idas {{ dbt.type_string() }}) =joined.components
150
+
151
+
{% elif col.name|lower=='issue_type' %}
152
+
left join issue_types
153
+
on cast(issue_types.issue_type_idas {{ dbt.type_string() }}) =joined.issue_type
154
+
155
+
{% elif col.name|lower not in exception_cols %}
156
+
left join field_option as field_option_{{ col.name }}
157
+
on cast(field_option_{{ col.name }}.field_id as {{ dbt.type_string() }}) = joined.{{ col.name }}
131
158
132
-
{% for col in pivot_data_columns if col.name|lower not in ['issue_id', 'issue_day_id', 'valid_starting_on', 'status', 'status_id', 'components'] %}
133
-
left join field_option as field_option_{{ col.name }}
134
-
on cast(field_option_{{ col.name }}.field_id as {{ dbt.type_string() }}) = {{ col.name }}
159
+
{% endif %}
135
160
{% endfor %}
136
161
),
137
162
@@ -144,15 +169,19 @@ fill_values as (
144
169
partition by issue_id, status_id_field_partition
145
170
order by date_day asc rows between unbounded preceding and current row) as status_id
146
171
147
-
{% for col in pivot_data_columns if col.name|lower=='components'and var('jira_using_components', True) %}
148
-
, first_value(components) over (partition by issue_id, component_field_partition order by date_day asc rows between unbounded preceding and current row) as components
149
-
{% endfor %}
172
+
{% for col in pivot_data_columns %}
173
+
{% if col.name|lower=='components'and var('jira_using_components', True) %}
174
+
, first_value(components) over (
175
+
partition by issue_id, component_field_partition
176
+
order by date_day asc rows between unbounded preceding and current row) as components
150
177
151
-
{% for col in pivot_data_columns if col.name|lower not in ['issue_id', 'issue_day_id', 'valid_starting_on', 'status', 'status_id', 'components'] %}
152
-
-- grab the value that started this batch/partition
153
-
, first_value( {{ col.name }} ) over (
154
-
partition by issue_id, {{ col.name }}_field_partition
155
-
order by date_day asc rows between unbounded preceding and current row) as {{ col.name }}
178
+
{% elif col.name|lower not in ['issue_id', 'issue_day_id', 'valid_starting_on', 'status', 'status_id', 'components'] %}
179
+
-- grab the value that started this batch/partition
180
+
, first_value( {{ col.name }} ) over (
181
+
partition by issue_id, {{ col.name }}_field_partition
182
+
order by date_day asc rows between unbounded preceding and current row) as {{ col.name }}
183
+
184
+
{% endif %}
156
185
{% endfor %}
157
186
158
187
from set_values
@@ -164,18 +193,17 @@ fix_null_values as (
164
193
date_day,
165
194
issue_id
166
195
167
-
{% for col in pivot_data_columns if col.name|lower=='components'and var('jira_using_components', True) %}
168
-
, case when components ='is_null' then null else components end as components
169
-
{% endfor %}
196
+
{% for col in pivot_data_columns %}
197
+
{% if col.name|lower=='components'and var('jira_using_components', True) %}
198
+
, case when components ='is_null' then null else components end as components
170
199
171
-
{% for col in pivot_data_columns if col.name|lower not in ['issue_id','issue_day_id','valid_starting_on', 'status', 'components'] %}
200
+
{% elif col.name|lower not in ['issue_id','issue_day_id','valid_starting_on', 'status', 'components'] %}
201
+
-- we de-nulled the true null values earlier in order to differentiate them from nulls that just needed to be backfilled
202
+
, case when {{ col.name }} ='is_null' then null else {{ col.name }} end as {{ col.name }}
172
203
173
-
-- we de-nulled the true null values earlier in order to differentiate them from nulls that just needed to be backfilled
174
-
, case when {{ col.name }} ='is_null' then null else {{ col.name }} end as {{ col.name }}
204
+
{% endif %}
175
205
{% endfor %}
176
206
177
-
178
-
179
207
from fill_values
180
208
181
209
),
@@ -187,12 +215,14 @@ surrogate_key as (
187
215
fix_null_values.issue_id,
188
216
statuses.status_nameas status
189
217
190
-
{% for col in pivot_data_columns if col.name|lower=='components'and var('jira_using_components', True) %}
191
-
, case when components ='is_null' then null else components end as components
192
-
{% endfor %}
218
+
{% for col in pivot_data_columns %}
219
+
{% if col.name|lower=='components'and var('jira_using_components', True) %}
220
+
, fix_null_values.componentsas components
221
+
222
+
{% elif col.name|lower not in ['issue_id','issue_day_id','valid_starting_on', 'status', 'components'] %}
223
+
, fix_null_values.{{ col.name }} as {{ col.name }}
193
224
194
-
{% for col in pivot_data_columns if col.name|lower not in ['issue_id','issue_day_id','valid_starting_on', 'status', 'components'] %}
195
-
, fix_null_values.{{ col.name }} as {{ col.name }}
225
+
{% endif %}
196
226
{% endfor %}
197
227
198
228
, {{ dbt_utils.generate_surrogate_key(['date_day','issue_id']) }} as issue_day_id
0 commit comments