-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Release] Version 0.8.1: Current_timestamp macro updates, pull request join fix #58
Changes from 3 commits
a37f6ff
4155417
2c1c0ec
96d2a9d
9d6e8d9
2c15471
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ logs/ | |
keyfile.json | ||
.DS_Store | ||
develop/ | ||
dbt_packages/ | ||
dbt_packages/ | ||
env/ | ||
package-lock.yml |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,18 @@ | ||||||||
# dbt_github v0.8.1 | ||||||||
[PR #58](https://github.com/fivetran/dbt_github/pull/58) contains the following updates: | ||||||||
|
||||||||
## Bug Fixes | ||||||||
- Replaced the existing `dbt_current_timestamp.backcompat()` with the up-to-date `dbt_current_timestamp` macro to generate the current timestamp for customers. [PR #58](https://github.com/fivetran/dbt_github/pull/58) | ||||||||
- Updated the join type in `int_github__pull_request_times` to not drop pull requests without explicit reviewers requested. [PR #57](https://github.com/fivetran/dbt_github/pull/57) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
## Under the Hood: | ||||||||
- Added consistency tests for `github__issues` and `github__pull_requests` to ensure new changes don't change the output of either model. There are conditions. [PR #58](https://github.com/fivetran/dbt_github/pull/58) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Reads a bit cryptic 😆. Can you expand on what this means? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh god. Fixing. |
||||||||
|
||||||||
## Contributors | ||||||||
- [@samkessaram](https://github.com/samkessaram) ([PR #57](https://github.com/fivetran/dbt_github/pull/57)) | ||||||||
|
||||||||
# dbt_github v0.8.0 | ||||||||
[PR #53](https://github.com/fivetran/dbt_jira/dbt_github/53) contains the following updates: | ||||||||
[PR #53](https://github.com/fivetran/dbt_github/pull/53) contains the following updates: | ||||||||
|
||||||||
## 🚨 Breaking Change 🚨 | ||||||||
- For consistency with other Fivetran packages, added default target schemas in `dbt_project.yml`. This is a breaking change since the model outputs will now be stored in a schema called `<your target schema>_github` by default. You will need to update any of your downstream use cases to point to the new schema. | ||||||||
|
@@ -80,6 +93,7 @@ | |||||||
|
||||||||
## Contributors | ||||||||
- [@jackiexsun](https://github.com/jackiexsun) ([#31](https://github.com/fivetran/dbt_github/pull/31)) | ||||||||
|
||||||||
# dbt_github v0.5.0 | ||||||||
## 🚨 Breaking Changes 🚨 | ||||||||
- The addition of the `label` source model results in the reference within `int_github__issue_label` to break. As a result, with the addition of upstream changes within `dbt_github_source` and the new `int_github__issue_label_join` model this issue has been resolved. ([#26](https://github.com/fivetran/dbt_github/pull/26)) | ||||||||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also add a test that explicitly checks the counts (and in the future other aggregates) of the impacted end model of this PR. For example, I would want to make sure that going forward the total row count matches between dev and prod. Something like the following would be great. {{ config(
tags="fivetran_validations",
enabled=var('fivetran_validation_tests_enabled', false)
) }}
with prod as (
select
1 as join_key,
count(*) as total_prod_pr_count
from {{ target.schema }}_github_prod.github__pull_requests
group by 1
),
dev as (
select
1 as join_key,
count(*) as total_dev_pr_count
from {{ target.schema }}_github_dev.github__pull_requests
group by 1
),
final as (
select
total_prod_pr_count,
total_dev_pr_count
from prod
full outer join dev
on dev.join_key = prod.join_key
)
select *
from final
where total_dev_pr_count != total_prod_pr_count As we found in the past the prod_not_in_dev and dev_not_in_prod approach doesn't always capture missing records as well as it does different records. So this added test should help close that gap! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A similar aggregate test for the issue table would be great to add as well. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
-- this test ensures the github__issues end model matches the prior version | ||
with prod as ( | ||
select * except(days_issue_open, labels, repository_team_names, assignees) --the differences in prod/dev run times will lead to discrepancies because it leverages current_timestamp, and string aggs don't always have the same order | ||
from {{ target.schema }}_github_prod.github__issues | ||
where date(updated_at) < date({{ dbt.current_timestamp() }}) | ||
), | ||
|
||
dev as ( | ||
select * except(days_issue_open, labels, repository_team_names, assignees) --the differences in prod/dev run times will lead to slight discrepancies because it leverages current_timestamp, and string aggs don't always order the same | ||
from {{ target.schema }}_github_dev.github__issues | ||
where date(updated_at) < date({{ dbt.current_timestamp() }}) | ||
), | ||
|
||
prod_not_in_dev as ( | ||
-- rows from prod not found in dev | ||
select * from prod | ||
except distinct | ||
select * from dev | ||
), | ||
|
||
dev_not_in_prod as ( | ||
-- rows from dev not found in prod | ||
select * from dev | ||
except distinct | ||
select * from prod | ||
), | ||
|
||
final as ( | ||
select | ||
*, | ||
'from prod' as source | ||
from prod_not_in_dev | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
select | ||
*, | ||
'from dev' as source | ||
from dev_not_in_prod | ||
) | ||
|
||
select * | ||
from final |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{{ config( | ||
tags="fivetran_validations", | ||
enabled=var('fivetran_validation_tests_enabled', false) | ||
) }} | ||
|
||
-- this test ensures the github__pull_requests end model matches the prior version | ||
with prod as ( | ||
select * except(days_issue_open, hours_request_review_to_first_review, hours_request_review_to_first_action, hours_request_review_to_merge) --the differences in prod/dev run times will lead to discrepancies because these fields leverages current_timestamp | ||
from {{ target.schema }}_github_prod.github__pull_requests | ||
where date(updated_at) < date({{ dbt.current_timestamp() }}) | ||
), | ||
|
||
dev as ( | ||
select * except(days_issue_open, hours_request_review_to_first_review, hours_request_review_to_first_action, hours_request_review_to_merge) --the differences in prod/dev run times will lead to discrepancies because these fields leverages current_timestamp | ||
from {{ target.schema }}_github_prod.github__pull_requests | ||
where date(updated_at) < date({{ dbt.current_timestamp() }}) | ||
), | ||
|
||
prod_not_in_dev as ( | ||
-- rows from prod not found in dev | ||
select * from prod | ||
except distinct | ||
select * from dev | ||
), | ||
|
||
dev_not_in_prod as ( | ||
-- rows from dev not found in prod | ||
select * from dev | ||
except distinct | ||
select * from prod | ||
), | ||
|
||
final as ( | ||
select | ||
*, | ||
'from prod' as source | ||
from prod_not_in_dev | ||
|
||
union all -- union since we only care if rows are produced | ||
|
||
select | ||
*, | ||
'from dev' as source | ||
from dev_not_in_prod | ||
) | ||
|
||
select * | ||
from final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a bit more to this entry explaining why this was an issue in the past and how this updated addresses that bug.