Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit eb6d313

Browse files
Merge pull request #19 from fivetran/bugfix/timestamp-casts
Bugfix/timestamp casts
2 parents 11b1b6f + 3567ae9 commit eb6d313

8 files changed

Lines changed: 14 additions & 9 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# dbt_github_source v0.4.1
2+
3+
## Fixes
4+
- Added the `{{ dbt_utils.type_timestamp() }}` cast function to timestamp fields within the staging models. This is required for Redshift users that have the fields originally synced as `timestamptz`. Without the casting of fields the downstream date functions will fail. ([#19](https://github.com/fivetran/dbt_github_source/pull/19))
5+
16
# dbt_github_source v0.4.0
27
🎉 dbt v1.0.0 Compatibility 🎉
38
## 🚨 Breaking Changes 🚨

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
config-version: 2
22

33
name: 'github_source'
4-
version: '0.4.0'
4+
version: '0.4.1'
55

66
require-dbt-version: [">=1.0.0", "<2.0.0"]
77

integration_tests/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'github_source_integration_tests'
2-
version: '0.3.0'
2+
version: '0.4.1'
33
config-version: 2
44

55
profile: 'integration_tests'

models/stg_github__issue.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ with issue as (
2626
select
2727
id as issue_id,
2828
body,
29-
closed_at,
30-
created_at,
29+
cast(closed_at as {{ dbt_utils.type_timestamp() }}) as closed_at,
30+
cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,
3131
locked as is_locked,
3232
milestone_id,
3333
number as issue_number,
3434
pull_request as is_pull_request,
3535
repository_id,
3636
state,
3737
title,
38-
updated_at,
38+
cast(updated_at as {{ dbt_utils.type_timestamp() }}) as updated_at,
3939
user_id
4040

4141
from macro

models/stg_github__issue_closed_history.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ with issue_closed_history as (
2525

2626
select
2727
issue_id,
28-
updated_at,
28+
cast(updated_at as {{ dbt_utils.type_timestamp() }}) as updated_at,
2929
closed as is_closed
3030

3131
from macro

models/stg_github__issue_merged.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ with issue_merged as (
2525

2626
select
2727
issue_id,
28-
merged_at
28+
cast(merged_at as {{ dbt_utils.type_timestamp() }}) as merged_at
2929

3030
from macro
3131
)

models/stg_github__pull_request_review.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ with pull_request_review as (
2626
select
2727
id as pull_request_review_id,
2828
pull_request_id,
29-
submitted_at,
29+
cast(submitted_at as {{ dbt_utils.type_timestamp() }}) as submitted_at,
3030
state,
3131
user_id
3232

models/stg_github__requested_reviewer_history.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ with requested_reviewer_history as (
2525

2626
select
2727
pull_request_id,
28-
created_at,
28+
cast(created_at as {{ dbt_utils.type_timestamp() }}) as created_at,
2929
requested_id,
3030
removed
3131

0 commit comments

Comments
 (0)