diff --git a/.github/PULL_REQUEST_TEMPLATE/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md rename to .github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e26047e..8e527910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ ## 🚨 Breaking Change (Snowflake users) 🚨 - We have changed our identifier logic in the initial Zendesk source package to account for `group` being both a Snowflake reserved word and a source table. Given `dbt_zendesk_source` is a dependency for this package, Snowflake users will want to execute a `dbt run --full-refresh` before using the new version of the package. [PR #42](https://github.com/fivetran/dbt_zendesk_source/pull/42) +## Bug Fixes +- Updates the `int_zendesk__schedule_spine` model to convert the Holiday schedules into proper UTC values before being used in comparison with the schedule times. This ensures the holidays are properly mapped to schedules regardless of timezones. + ## 🚀 Feature Updates 🚀 - Added `solve_time_in_calendar_minutes` and `solve_time_in_business_minutes` to our `zendesk__ticket_metrics` model, which calculates calendar and business minutes for when the ticket was in the 'new', 'open', 'hold', or 'pending' status. ## 🔎 Under the Hood 🔎 - Updated the seed files and seed file configurations for the package integration tests to align with changes in dbt_zendesk_source made in [PR #42](https://github.com/fivetran/dbt_zendesk_source/pull/42) for applying the `dbt_utils.star` macro. +- Corrected the folder structure for the `.github` folder to properly categorize the Community and Maintainer PR templates. + +## Contributors +- [@cth84](https://github.com/cth84) ([PR #118](https://github.com/fivetran/dbt_zendesk/pull/118)) # dbt_zendesk v0.12.0 diff --git a/dbt_project.yml b/dbt_project.yml index cf35ca88..409883da 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,6 +1,7 @@ name: 'zendesk' version: '0.13.0' + config-version: 2 require-dbt-version: [">=1.3.0", "<2.0.0"] on-run-start: '{{ fivetran_utils.empty_variable_warning("ticket_field_history_columns", "zendesk_ticket_field_history") }}' diff --git a/integration_tests/ci/sample.profiles.yml b/integration_tests/ci/sample.profiles.yml index 0c6ae797..de11755e 100644 --- a/integration_tests/ci/sample.profiles.yml +++ b/integration_tests/ci/sample.profiles.yml @@ -16,13 +16,13 @@ integration_tests: pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}" dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}" port: 5439 - schema: zendesk_integration_tests_3 + schema: zendesk_integration_tests_40 threads: 8 bigquery: type: bigquery method: service-account-json project: 'dbt-package-testing' - schema: zendesk_integration_tests_3 + schema: zendesk_integration_tests_40 threads: 8 keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}" snowflake: @@ -33,7 +33,7 @@ integration_tests: role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}" database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}" warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}" - schema: zendesk_integration_tests_3 + schema: zendesk_integration_tests_40 threads: 8 postgres: type: postgres @@ -42,13 +42,13 @@ integration_tests: pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}" dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}" port: 5432 - schema: zendesk_integration_tests_3 + schema: zendesk_integration_tests_40 threads: 8 databricks: catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}" host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}" http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}" - schema: zendesk_integration_tests_3 + schema: zendesk_integration_tests_40 threads: 8 token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}" type: databricks \ No newline at end of file diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 83ef22d5..c33d0b73 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -6,7 +6,7 @@ version: '0.13.0' profile: 'integration_tests' vars: - zendesk_schema: zendesk_integration_tests_3 + zendesk_schema: zendesk_integration_tests_40 zendesk_source: zendesk_organization_identifier: "organization_data" zendesk_schedule_identifier: "schedule_data" diff --git a/models/intermediate/int_zendesk__schedule_spine.sql b/models/intermediate/int_zendesk__schedule_spine.sql index f7d2ea12..b242ceae 100644 --- a/models/intermediate/int_zendesk__schedule_spine.sql +++ b/models/intermediate/int_zendesk__schedule_spine.sql @@ -93,7 +93,7 @@ with timezone as ( schedule.schedule_name, schedule.start_time - coalesce(split_timezones.offset_minutes, 0) as start_time_utc, schedule.end_time - coalesce(split_timezones.offset_minutes, 0) as end_time_utc, - + coalesce(split_timezones.offset_minutes, 0) as offset_minutes_to_add, -- we'll use these to determine which schedule version to associate tickets with cast(split_timezones.valid_from as {{ dbt.type_timestamp() }}) as valid_from, cast(split_timezones.valid_until as {{ dbt.type_timestamp() }}) as valid_until @@ -105,7 +105,7 @@ with timezone as ( -- Now we need take holiday's into consideration and perform the following transformations to account for Holidays in existing schedules ), holiday_start_end_times as ( - select + select calculate_schedules.*, schedule_holiday.holiday_name, schedule_holiday.holiday_start_date_at, @@ -122,10 +122,12 @@ with timezone as ( ), holiday_minutes as( select - *, - {{ dbt.datediff("holiday_week_start", "holiday_start_date_at", "minute") }} as minutes_from_sunday_start, - {{ dbt.datediff("holiday_week_start", "holiday_end_date_at", "minute") }} as minutes_from_sunday_end + holiday_start_end_times.*, + {{ dbt.datediff("holiday_week_start", "holiday_start_date_at", "minute") }} - coalesce(timezone.standard_offset_minutes, 0) as minutes_from_sunday_start, + {{ dbt.datediff("holiday_week_start", "holiday_end_date_at", "minute") }} - coalesce(timezone.standard_offset_minutes, 0) as minutes_from_sunday_end from holiday_start_end_times + left join timezone + on timezone.time_zone = holiday_start_end_times.time_zone -- Determine which schedule days include a holiday ), holiday_check as (