Skip to content

Commit 1856dd4

Browse files
bugfix/string-agg-removal (#119)
* bugfix/string-agg-removal * regen docs and changelog update * readme version bump * Apply suggestions from code review Co-authored-by: Renee Li <[email protected]> * review updates and docs regen * docs regen --------- Co-authored-by: Renee Li <[email protected]>
1 parent 2fe07aa commit 1856dd4

10 files changed

+33
-34
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# dbt_fivetran_log v1.7.0
2+
[PR #119](https://github.com/fivetran/dbt_fivetran_log/pull/119) includes the following updates:
3+
4+
## 🚨 Breaking Changes 🚨: Bug Fixes
5+
- The following fields have been deprecated (removed) as these fields proved to be problematic across warehouses due to the end size of the fields.
6+
- `errors_since_last_completed_sync`
7+
- `warnings_since_last_completed_sync`
8+
> Note: If you found these fields to be relevant, you may still reference the error/warning messages from within the underlying `log` table.
9+
- The `fivetran_platform_using_sync_alert_messages` variable has been removed as it is no longer necessary due to the above changes.
10+
11+
## Feature Updates
12+
- The following fields have been added to display the number of error/warning messages sync last completed sync. These fields are intended to substitute the information from deprecated fields listed above.
13+
- `number_errors_since_last_completed_sync`
14+
- `number_warnings_since_last_completed_sync`
15+
116
# dbt_fivetran_log v1.6.0
217
[PR #117](https://github.com/fivetran/dbt_fivetran_log/pull/117) includes the following updates as a result of users encountering numeric counts exceeding the limit of a standard integer. Therefore, these fields were required to be cast as `bigint` in order to avoid "integer out of range" errors:
318

README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ Include the following Fivetran Platform package version range in your `packages.
6666
```yaml
6767
packages:
6868
- package: fivetran/fivetran_log
69-
version: [">=1.6.0", "<1.7.0"]
69+
version: [">=1.7.0", "<1.8.0"]
7070
```
7171

72-
> Note that altough the source connector is now "Fivetran Platform", the package retains the old name of "fivetran_log".
72+
> Note that although the source connector is now "Fivetran Platform", the package retains the old name of "fivetran_log".
7373

7474
## Step 3: Define Database and Schema Variables
7575
By default, this package will run using your target database and the `fivetran_log` schema. If this is not where your Fivetran Platform data is (perhaps your fivetran platform schema is `fivetran_platform`), add the following configuration to your root `dbt_project.yml` file:
@@ -91,14 +91,6 @@ vars:
9191

9292
## (Optional) Step 5: Additional Configurations
9393

94-
### Configuring Fivetran Error and Warning Messages
95-
Some users may wish to exclude Fivetran error and warnings messages from the final `fivetran_platform__connector_status` model due to the length of the message. To disable the `errors_since_last_completed_sync` and `warnings_since_last_completed_sync` fields from the final model you may add the following variable to you to your root `dbt_project.yml` file. By default, this variable is assumed to be `true`:
96-
97-
```yml
98-
vars:
99-
fivetran_platform_using_sync_alert_messages: false # this will disable only the sync alert messages within the connector status model
100-
```
101-
10294
### Change the Build Schema
10395
By default this package will build the Fivetran staging models within a schema titled (<target_schema> + `_stg_fivetran_platform`) and the Fivetran Platform final models within your <target_schema> + `_fivetran_platform` in your target database. If this is not where you would like you Fivetran staging and final models to be written to, add the following configuration to your root `dbt_project.yml` file:
10496

dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config-version: 2
22
name: 'fivetran_log'
3-
version: '1.6.0'
3+
version: '1.7.0'
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55

66
models:

docs/catalog.json

+1-1
Large diffs are not rendered by default.

docs/index.html

+2-2
Large diffs are not rendered by default.

docs/manifest.json

+1-1
Large diffs are not rendered by default.

docs/run_results.json

+1-1
Large diffs are not rendered by default.

integration_tests/dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'fivetran_log_integration_tests'
2-
version: '1.6.0'
2+
version: '1.7.0'
33

44
config-version: 2
55
profile: 'integration_tests'

models/fivetran_platform.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,11 @@ models:
5353
description: >
5454
The number of schema changes (creating tables or schemas and altering tables) in the past 30 days.
5555
56-
- name: errors_since_last_completed_sync
57-
description: >
58-
Aggregated line-separated list of error messages (in JSON format) raised synce the last
59-
sync completion. Included by default for non-SQL Server targets, but can be disabled by setting
60-
the `fivetran_platform_using_sync_alert_messages` var to False.
56+
- name: number_errors_since_last_completed_sync
57+
description: Numeric metric indicating the number of error messages raised since the last sync completion.
6158

62-
- name: warnings_since_last_completed_sync
63-
description: >
64-
Aggregated line-separated list of warning messages (in JSON format) raised synce the last
65-
sync completion. Included by default for non-SQL Server targets, but can be disabled by setting
66-
the `fivetran_platform_using_sync_alert_messages` var to False.
59+
- name: number_warnings_since_last_completed_sync
60+
description: Numeric metric indicating the number of warning messages raised since the last sync completion.
6761

6862

6963
- name: fivetran_platform__mar_table_history

models/fivetran_platform__connector_status.sql

+5-7
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,9 @@ final as (
198198
connector_recent_logs.last_sync_started_at,
199199
connector_recent_logs.last_sync_completed_at,
200200
connector_recent_logs.set_up_at,
201-
coalesce(schema_changes.number_of_schema_changes_last_month, 0) as number_of_schema_changes_last_month
202-
203-
{% if var('fivetran_platform_using_sync_alert_messages', true) and target.type != 'sqlserver' %}
204-
, {{ fivetran_utils.string_agg("distinct case when connector_recent_logs.event_type = 'SEVERE' then connector_recent_logs.message_data else null end", "'\\n'") }} as errors_since_last_completed_sync
205-
, {{ fivetran_utils.string_agg("distinct case when connector_recent_logs.event_type = 'WARNING' then connector_recent_logs.message_data else null end", "'\\n'") }} as warnings_since_last_completed_sync
206-
{% endif %}
201+
coalesce(schema_changes.number_of_schema_changes_last_month, 0) as number_of_schema_changes_last_month,
202+
count(case when connector_recent_logs.event_type = 'SEVERE' then connector_recent_logs.message_data else null end) as number_errors_since_last_completed_sync,
203+
count(case when connector_recent_logs.event_type = 'WARNING' then connector_recent_logs.message_data else null end) as number_warnings_since_last_completed_sync
207204

208205
from connector_recent_logs
209206
left join schema_changes
@@ -226,4 +223,5 @@ final as (
226223
schema_changes.number_of_schema_changes_last_month
227224
)
228225

229-
select * from final
226+
select *
227+
from final

0 commit comments

Comments
 (0)