Skip to content

Commit

Permalink
Merge pull request #51 from fivetran/bugfix/transformation-log-and-ch…
Browse files Browse the repository at this point in the history
…angelog-test

Bugfix/transformation log and changelog test
  • Loading branch information
fivetran-joemarkiewicz authored Apr 20, 2022
2 parents 89251bc + b6eda29 commit 4690ad5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# dbt_fivetran_log v0.5.4
## Fixes
- The unique combination of columns test within the `fivetran_log__schema_changelog` model has been updated to also check the `message_data` field. This is needed as schema changelog events may now sync at the same time. ([#51](https://github.com/fivetran/dbt_fivetran_log/pull/51))
- The `fivetran_log__connector_status` model has been adjusted to filter out all logs that contain a `transformation_id`. Transformation logs are not always synced as a JSON object and thus the package may encounter errors on Snowflake warehouses when parsing non-JSON fields. Since transformation records are not used in this end model, they have been filtered out. ([#51](https://github.com/fivetran/dbt_fivetran_log/pull/51))
# dbt_fivetran_log v0.5.3
## Fixes
- Per the [Fivetran Log December 2021 Release Notes](https://fivetran.com/docs/logs/changelog#december2021) every sync results in a final `sync_end` event. In the previous version of this package, a successful sync was identified via a `sync_end` event while anything else was a version of broken. Since all syncs result in a `sync_end` event now, the package has been updated to account for this change within the connector.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'fivetran_log'
version: '0.5.3'
version: '0.5.4'

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

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ integration_tests:
spark:
type: spark
method: http
schema: fivetran_log_tests
schema: fivetran_log__integration_test
host: "{{ env_var('CI_SPARK_DBT_HOST') }}"
organization: "{{ env_var('CI_SPARK_DBT_ORGANIZATION') }}"
token: "{{ env_var('CI_SPARK_DBT_TOKEN') }}"
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'fivetran_log_integration_tests'
version: '0.5.3'
version: '0.5.4'
config-version: 2
profile: 'integration_tests'

Expand Down
3 changes: 2 additions & 1 deletion models/fivetran_log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ models:
combination_of_columns:
- connector_id
- destination_id
- message_data
- created_at
columns:
- name: connector_id
Expand All @@ -310,4 +311,4 @@ models:
- name: table_name
description: Name of the table, if a table is being altered or created.
- name: schema_name
description: Name of the schema, if a schema or table is being created.
description: Name of the schema, if a schema or table is being created.
15 changes: 11 additions & 4 deletions models/fivetran_log__connector_status.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
with connector_log as (
with transformation_removal as (

select *,
sum( case when event_subtype in ('sync_start') then 1 else 0 end) over ( partition by connector_id
order by created_at rows unbounded preceding) as sync_batch_id
select *
from {{ ref('stg_fivetran_log__log') }}
where transformation_id is null

),

connector_log as (
select
*,
sum( case when event_subtype in ('sync_start') then 1 else 0 end) over ( partition by connector_id
order by created_at rows unbounded preceding) as sync_batch_id
from transformation_removal
-- only looking at errors, warnings, and syncs here
where event_type = 'SEVERE'
or event_type = 'WARNING'
Expand Down

0 comments on commit 4690ad5

Please sign in to comment.