-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* stage changes * seed * bk * add seed back in * add using_holidays * doc updates * fix vars * fix vars * Update vars * update yml * update changelog & regen docs * update var names, readme, regen docs * update run models * update changelog * Apply suggestions from code review Co-authored-by: Joe Markiewicz <[email protected]> * Apply suggestions from code review Co-authored-by: Jamie Rodriguez <[email protected]> --------- Co-authored-by: Jamie Rodriguez <[email protected]> Co-authored-by: Joe Markiewicz <[email protected]>
- Loading branch information
1 parent
fd7ffca
commit 8b9ca18
Showing
16 changed files
with
167 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
id,_fivetran_synced,action,actor_id,change_description,created_at,source_id,source_label,source_type | ||
579796,2024-05-28 21:53:06.793000,update,37253,"Workweek changed from {:sun=&gt;{""01:45""=&gt;""02:45""}, :mon=&gt;{""09:00""=&gt;""20:00""}, :tue=&gt;{""09:00""=&gt;""20:00""}, :wed=&gt;{""08:00""=&gt;""20:00""}, :thu=&gt;{""08:00""=&gt;""20:00""}, :fri=&gt;{""08:00""=&gt;""20:00""}} to {:sun=&gt;{""03:00""=&gt;""04:00""}, :mon=&gt;{""08:00""=&gt;""20:00""}, :tue=&gt;{""08:00""=&gt;""20:00""}, :wed=&gt;{""07:15""=&gt;""20:00""}, :thu=&gt;{""07:15""=&gt;""20:00""}, :fri=&gt;{""07:15""=&gt;""20:00""}}",2024-05-28 21:51:37.000000,18542,Workweek: Central US Schedule,zendesk/business_hours/workweek | ||
2679952,2024-05-28 16:18:58.471000,update,37253,"Workweek changed from {:thu=&gt;{""09:00""=&gt;""17:00""}, :fri=&gt;{""09:00""=&gt;""17:00""}, :mon=&gt;{""09:00""=&gt;""17:00""}, :tue=&gt;{""09:00""=&gt;""17:00""}, :wed=&gt;{""09:00""=&gt;""17:00""}} to {:mon=&gt;{""09:00""=&gt;""17:00""}, :tue=&gt;{""09:00""=&gt;""17:00""}, :wed=&gt;{""09:00""=&gt;""17:00""}, :thu=&gt;{""09:00""=&gt;""17:00""}, :fri=&gt;{""09:00""=&gt;""17:00""}}",2024-05-21 11:20:29.000000,267996,Workweek: New schedule here,zendesk/business_hours/workweek | ||
293556,2024-05-28 16:18:58.471000,update,37253,"Workweek changed from {} to {:mon=&gt;{""09:00""=&gt;""17:00""}, :tue=&gt;{""09:00""=&gt;""17:00""}, :wed=&gt;{""09:00""=&gt;""17:00""}, :thu=&gt;{""09:00""=&gt;""17:00""}, :fri=&gt;{""09:00""=&gt;""17:00""}}",2024-05-21 11:20:28.000000,267996,Workweek: New schedule here,zendesk/business_hours/workweek | ||
4441364,2024-05-28 16:18:58.471000,update,37253,"Workweek changed from {:wed=&gt;{""09:00""=&gt;""17:00""}, :thu=&gt;{""09:00""=&gt;""17:00""}, :mon=&gt;{""09:00""=&gt;""17:00""}, :tue=&gt;{""09:00""=&gt;""17:00""}, :fri=&gt;{""09:00""=&gt;""17:00""}} to {:mon=&gt;{""09:00""=&gt;""17:00""}, :tue=&gt;{""09:00""=&gt;""17:00""}, :wed=&gt;{""09:00""=&gt;""17:00""}, :thu=&gt;{""09:00""=&gt;""17:00""}, :fri=&gt;{""09:00""=&gt;""17:00""}}",2024-05-21 11:20:10.000000,267996,Workweek: New schedule 2,zendesk/business_hours/workweek | ||
70900,2024-05-28 16:18:58.471000,update,37253,"Workweek changed from {} to {:mon=&gt;{""09:00""=&gt;""17:00""}, :tue=&gt;{""09:00""=&gt;""17:00""}, :wed=&gt;{""09:00""=&gt;""17:00""}, :thu=&gt;{""09:00""=&gt;""17:00""}, :fri=&gt;{""09:00""=&gt;""17:00""}}",2024-05-21 11:20:09.000000,267996,Workweek: New schedule 2,zendesk/business_hours/workweek | ||
70901,2024-05-28 16:18:58.471000,update,37253,"Workweek changed from {"mon":{"10:00":"20:00"},"tue":{"10:00":"20:00"},"wed":{"10:00":"20:00"},"thu":{"10:00":"20:00"},"fri":{"10:00":"20:00"}} to {"mon":{"10:00":"22:00"},"tue":{"10:00":"22:00"},"wed":{"10:00":"22:00"},"thu":{"10:00":"22:00"},"fri":{"10:00":"22:00"}}",2024-05-21 11:20:09.000000,267996,Workweek: New schedule 2,zendesk/business_hours/workweek | ||
70902,2024-05-28 16:18:58.471000,update,37253,"Workweek changed from {:mon=&gt;{""09:00""=&gt;""10:45"", ""11:45""=&gt;""12:45"", ""13:45""=&gt;""14:45"", ""15:15""=&gt;""16:15"", ""19:00""=&gt;""20:00"", ""17:30""=&gt;""18:30""}, :tue=&gt;{""00:15""=&gt;""13:15"", ""13:30""=&gt;""18:30"", ""18:45""=&gt;""21:45"", ""22:00""=&gt;""24:00""}, :wed=&gt;{""09:00""=&gt;""21:00""}, :thu=&gt;{""17:00""=&gt;""18:00"", ""19:45""=&gt;""20:45"", ""09:00""=&gt;""10:45"", ""12:15""=&gt;""13:15"", ""14:30""=&gt;""15:30""}, :fri=&gt;{""09:00""=&gt;""12:45"", ""19:15""=&gt;""22:30"", ""14:45""=&gt;""15:45"", ""17:30""=&gt;""18:30""}} to {:mon=&gt;{""09:00""=&gt;""10:45"", ""11:45""=&gt;""12:45"", ""13:45""=&gt;""14:45"", ""15:15""=&gt;""16:15"", ""17:30""=&gt;""18:30"", ""19:00""=&gt;""20:00""}, :tue=&gt;{""00:15""=&gt;""13:15"", ""13:30""=&gt;""18:30"", ""18:45""=&gt;""21:45"", ""22:00""=&gt;""24:00""}, :wed=&gt;{""02:30""=&gt;""21:45""}, :thu=&gt;{""09:00""=&gt;""10:45"", ""12:15""=&gt;""13:15"", ""14:30""=&gt;""15:30"", ""17:00""=&gt;""18:00"", ""19:45""=&gt;""20:45""}, :fri=&gt;{""09:00""=&gt;""12:45"", ""14:45""=&gt;""15:45"", ""17:30""=&gt;""18:30"", ""19:15""=&gt;""22:30""}}",2024-05-21 11:20:09.000000,267996,Workweek: New schedule 2,zendesk/business_hours/workweek |
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,17 @@ | ||
{% macro get_audit_log_columns() %} | ||
|
||
{% set columns = [ | ||
{"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, | ||
{"name": "id", "datatype": dbt.type_int()}, | ||
{"name": "action", "datatype": dbt.type_string()}, | ||
{"name": "actor_id", "datatype": dbt.type_int()}, | ||
{"name": "change_description", "datatype": dbt.type_string()}, | ||
{"name": "created_at", "datatype": dbt.type_timestamp()}, | ||
{"name": "source_id", "datatype": dbt.type_int()}, | ||
{"name": "source_label", "datatype": dbt.type_string()}, | ||
{"name": "source_type", "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,45 @@ | ||
{{ config(enabled=var('using_schedules', True) and var('using_schedule_histories', False)) }} | ||
|
||
with base as ( | ||
|
||
select * | ||
from {{ ref('stg_zendesk__audit_log_tmp') }} | ||
|
||
), | ||
|
||
fields as ( | ||
|
||
select | ||
/* | ||
The below macro is used to generate the correct SQL for package staging models. It takes a list of columns | ||
that are expected/needed (staging_columns from dbt_zendesk_source/models/tmp/) and compares it with columns | ||
in the source (source_columns from dbt_zendesk_source/macros/). | ||
For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git). | ||
*/ | ||
{{ | ||
fivetran_utils.fill_staging_columns( | ||
source_columns=adapter.get_columns_in_relation(ref('stg_zendesk__audit_log_tmp')), | ||
staging_columns=get_audit_log_columns() | ||
) | ||
}} | ||
|
||
from base | ||
), | ||
|
||
final as ( | ||
select | ||
cast(id as {{ dbt.type_string() }}) as audit_log_id, | ||
action, | ||
actor_id, | ||
change_description, | ||
cast(created_at as {{ dbt.type_timestamp() }}) as created_at, | ||
source_id, | ||
source_label, | ||
source_type, | ||
_fivetran_synced | ||
|
||
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
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,4 @@ | ||
{{ config(enabled=var('using_schedules', True) and var('using_schedule_histories', False)) }} | ||
|
||
select {{ dbt_utils.star(source('zendesk','audit_log')) }} | ||
from {{ source('zendesk','audit_log') }} as audit_log_table |
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 |
---|---|---|
@@ -1,5 +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)) }} | ||
--To disable this model, set the using_schedules or using_holidays variable within your dbt_project.yml file to False. | ||
{{ config(enabled=var('using_schedules', True) and var('using_holidays', True)) }} | ||
|
||
select {{ dbt_utils.star(source('zendesk', 'schedule_holiday')) }} | ||
from {{ source('zendesk', 'schedule_holiday') }} as schedule_holiday_table |