-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfix/add_schedule_holiday' into MagicBot/integation-t…
…est-webhooks-14
- Loading branch information
Showing
17 changed files
with
125 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id,schedule_id,_fivetran_deleted,_fivetran_synced,end_date,name,start_date | ||
11630286047764,11630270684308,FALSE,2023-01-19 21:53:06.281,2022-12-27,Test Holiday,2022-12-26 | ||
11630270740884,11630270684308,FALSE,2023-01-19 21:53:06.281,2022-12-29,Test Holiday 2,2022-12-29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% macro get_schedule_holiday_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_deleted", "datatype": "boolean"}, | ||
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, | ||
{"name": "end_date", "datatype": dbt.type_string()}, | ||
{"name": "id", "datatype": dbt.type_int()}, | ||
{"name": "name", "datatype": dbt.type_string()}, | ||
{"name": "schedule_id", "datatype": dbt.type_int()}, | ||
{"name": "start_date", "datatype": dbt.type_string()} | ||
] %} | ||
|
||
{{ return(columns) }} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--To disable this model, set the using_schedules variable within your dbt_project.yml file to False. | ||
{{ config(enabled=var('using_schedules', True)) }} | ||
|
||
with base as ( | ||
|
||
select * | ||
from {{ ref('stg_zendesk__schedule_holiday_tmp') }} | ||
), | ||
|
||
fields as ( | ||
|
||
select | ||
{{ | ||
fivetran_utils.fill_staging_columns( | ||
source_columns=adapter.get_columns_in_relation(ref('stg_zendesk__schedule_holiday_tmp')), | ||
staging_columns=get_schedule_holiday_columns() | ||
) | ||
}} | ||
from base | ||
), | ||
|
||
final as ( | ||
|
||
select | ||
_fivetran_deleted, | ||
cast(_fivetran_synced as {{ dbt.type_timestamp() }} ) as _fivetran_synced, | ||
cast(end_date as {{ dbt.type_timestamp() }} ) as holiday_end_date_at, | ||
cast(id as {{ dbt.type_string() }} ) as holiday_id, | ||
name as holiday_name, | ||
cast(schedule_id as {{ dbt.type_string() }} ) as schedule_id, | ||
cast(start_date as {{ dbt.type_timestamp() }} ) as holiday_start_date_at | ||
from fields | ||
) | ||
|
||
select * | ||
from final |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--To disable this model, set the using_schedules variable within your dbt_project.yml file to False. | ||
{{ config(enabled=var('using_schedules', True)) }} | ||
|
||
select * | ||
from {{ var('schedule_holiday') }} |