Skip to content

Commit 9474332

Browse files
bug/too-many-partitions (#131)
* bug/too-many-partitions * updates * updates and regen docs * incremental updates * simplify incremental * update materialization * regen docs * update yml * review updates * Apply suggestions from code review Co-authored-by: Avinash Kunnath <[email protected]> * update readme * update changelog --------- Co-authored-by: Avinash Kunnath <[email protected]>
1 parent 5b002d5 commit 9474332

16 files changed

+223
-130
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# dbt_jira v0.18.0
2+
[PR #131](https://github.com/fivetran/dbt_jira/pull/131) contains the following updates:
3+
## Breaking Changes
4+
> Since the following changes are breaking, a `--full-refresh` after upgrading will be required.
5+
6+
- Changed the partitioning from days to weeks in the following models for BigQuery and Databricks All Purpose Cluster destinations:
7+
- `int_jira__pivot_daily_field_history`
8+
- Added field `valid_starting_at_week` for use with the new weekly partition logic.
9+
- `jira__daily_issue_field_history`
10+
- Added field `date_week` for use with the new weekly partition logic.
11+
- This adjustment reduces the total number of partitions, helping avoid partition limit issues in certain warehouses.
12+
- For Databricks All Purpose Cluster destinations, updated the `file_format` to `delta` for improved performance.
13+
- Updated the default materialization of `int_jira__issue_calendar_spine` from incremental to ephemeral to improve performance and maintainability.
14+
15+
## Documentation Update
16+
- Updated [README](https://github.com/fivetran/dbt_jira/blob/main/README.md#lookback-window) with the new default of 1 week for the `lookback_window` variable.
17+
18+
## Under the Hood
19+
- Replaced the deprecated `dbt.current_timestamp_backcompat()` function with `dbt.current_timestamp()` to ensure all timestamps are captured in UTC for the following models:
20+
- `int_jira__issue_calendar_spine`
21+
- `int_jira__issue_join`
22+
- `jira__issue_enhanced`
23+
- Updated model `int_jira__issue_calendar_spine` to prevent errors during compilation.
24+
- Added consistency tests for the `jira__daily_issue_field_history` and `jira__issue_enhanced` models.
25+
126
# dbt_jira v0.17.0
227
[PR #127](https://github.com/fivetran/dbt_jira/pull/127) contains the following updates:
328

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Include the following jira package version in your `packages.yml` file:
6666
```yaml
6767
packages:
6868
- package: fivetran/jira
69-
version: [">=0.17.0", "<0.18.0"]
69+
version: [">=0.18.0", "<0.19.0"]
7070
7171
```
7272
### Step 3: Define database and schema variables
@@ -142,14 +142,14 @@ vars:
142142
```
143143

144144
#### Lookback Window
145-
Records from the source can sometimes arrive late. Since several of the models in this package are incremental, by default we look back 3 days to ensure late arrivals are captured while avoiding the need for frequent full refreshes. While the frequency can be reduced, we still recommend running `dbt --full-refresh` periodically to maintain data quality of the models.
145+
Records from the source may occasionally arrive late. To handle this, we implement a one-week lookback in our incremental models to capture late arrivals without requiring frequent full refreshes. The lookback is structured in weekly increments, as the incremental logic is based on weekly periods. While the frequency of full refreshes can be reduced, we still recommend running `dbt --full-refresh` periodically to maintain data quality of the models.
146146

147147
To change the default lookback window, add the following variable to your `dbt_project.yml` file:
148148

149149
```yml
150150
vars:
151151
jira:
152-
lookback_window: number_of_days # default is 3
152+
lookback_window: number_of_weeks # default is 1
153153
```
154154

155155
### (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'jira'
2-
version: '0.17.0'
2+
version: '0.18.0'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55
vars:

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/index.html

Lines changed: 10 additions & 37 deletions
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/run_results.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

integration_tests/dbt_project.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'jira_integration_tests'
2-
version: '0.17.0'
2+
version: '0.18.0'
33
config-version: 2
44
profile: 'integration_tests'
55

@@ -28,11 +28,13 @@ vars:
2828
jira_user_identifier: "user"
2929
jira_version_identifier: "version"
3030

31+
# Comment out the below when generating docs
3132
issue_field_history_columns: ['summary', 'story points', 'components']
3233

3334
models:
3435
jira:
3536
+schema: "{{ 'jira_integrations_tests_sqlw' if target.name == 'databricks-sql' else 'jira' }}"
37+
# +schema: "jira_{{ var('directed_schema','dev') }}"
3638

3739
seeds:
3840
jira_integration_tests:
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
{{ config(
3+
tags="fivetran_validations",
4+
enabled=var('fivetran_validation_tests_enabled', false)
5+
) }}
6+
7+
with prod as (
8+
select
9+
date_day,
10+
issue_id,
11+
status,
12+
status_id,
13+
sprint,
14+
issue_day_id
15+
from {{ target.schema }}_jira_prod.jira__daily_issue_field_history
16+
),
17+
18+
dev as (
19+
select
20+
date_day,
21+
issue_id,
22+
status,
23+
status_id,
24+
sprint,
25+
issue_day_id
26+
from {{ target.schema }}_jira_dev.jira__daily_issue_field_history
27+
),
28+
29+
prod_not_in_dev as (
30+
-- rows from prod not found in dev
31+
select * from prod
32+
except distinct
33+
select * from dev
34+
),
35+
36+
dev_not_in_prod as (
37+
-- rows from dev not found in prod
38+
select * from dev
39+
except distinct
40+
select * from prod
41+
),
42+
43+
final as (
44+
select
45+
*,
46+
'from prod' as source
47+
from prod_not_in_dev
48+
49+
union all -- union since we only care if rows are produced
50+
51+
select
52+
*,
53+
'from dev' as source
54+
from dev_not_in_prod
55+
)
56+
57+
select *
58+
from final
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
{{ config(
3+
tags="fivetran_validations",
4+
enabled=var('fivetran_validation_tests_enabled', false)
5+
) }}
6+
7+
with prod as (
8+
select *
9+
from {{ target.schema }}_jira_prod.jira__issue_enhanced
10+
),
11+
12+
dev as (
13+
select *
14+
from {{ target.schema }}_jira_dev.jira__issue_enhanced
15+
),
16+
17+
prod_not_in_dev as (
18+
-- rows from prod not found in dev
19+
select * from prod
20+
except distinct
21+
select * from dev
22+
),
23+
24+
dev_not_in_prod as (
25+
-- rows from dev not found in prod
26+
select * from dev
27+
except distinct
28+
select * from prod
29+
),
30+
31+
final as (
32+
select
33+
*,
34+
'from prod' as source
35+
from prod_not_in_dev
36+
37+
union all -- union since we only care if rows are produced
38+
39+
select
40+
*,
41+
'from dev' as source
42+
from dev_not_in_prod
43+
)
44+
45+
select *
46+
from final

0 commit comments

Comments
 (0)