From d979c82ba05b7de5c772d03d9f92c187cca603fa Mon Sep 17 00:00:00 2001 From: Rochelle Smits-Seemann Date: Fri, 23 Aug 2024 10:23:25 +0200 Subject: [PATCH 1/2] Add incremental variable for overlap --- models/staging/stg_query_history.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/staging/stg_query_history.sql b/models/staging/stg_query_history.sql index e7da17c..5f2dd02 100644 --- a/models/staging/stg_query_history.sql +++ b/models/staging/stg_query_history.sql @@ -76,7 +76,7 @@ from {{ source('snowflake_account_usage', 'query_history') }} {% if is_incremental() %} -- must use end time in case query hasn't completed -- add lookback window of 2 days to account for late arriving queries - where end_time > (select dateadd(day, -2, coalesce(max(end_time), '1970-01-01') ) from {{ this }}) + where end_time > (select dateadd(day, -{{ var('dbt_snowflake_monitoring_incremental_days', '2') }}, coalesce(max(end_time), '1970-01-01') ) from {{ this }}) {% endif %} order by start_time From da3fc047aae2d1176101951064e05377843616e2 Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Fri, 23 Aug 2024 13:28:47 +0100 Subject: [PATCH 2/2] New release --- .changes/5.3.1.md | 9 +++++++++ CHANGELOG.md | 10 ++++++++++ dbt_project.yml | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .changes/5.3.1.md diff --git a/.changes/5.3.1.md b/.changes/5.3.1.md new file mode 100644 index 0000000..5ba1734 --- /dev/null +++ b/.changes/5.3.1.md @@ -0,0 +1,9 @@ +## dbt-snowflake-monitoring 5.3.1 - August 23, 2024 + +### Features + +- Add lookback variable to stg_query_history ([#163](https://github.com/get-select/dbt-snowflake-monitoring/pull/163)) + +### Contributors +- [@smitsrr](https://github.com/smitsrr) (Features) + diff --git a/CHANGELOG.md b/CHANGELOG.md index 20f45ce..8966277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-snowflake-monitoring 5.3.1 - August 23, 2024 + +### Features + +- Add lookback variable to stg_query_history ([#163](https://github.com/get-select/dbt-snowflake-monitoring/pull/163)) + +### Contributors +- [@smitsrr](https://github.com/smitsrr) (Features) + + ## dbt-snowflake-monitoring 5.3.0 - June 15, 2024 ### Features diff --git a/dbt_project.yml b/dbt_project.yml index 06eda97..396205b 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'dbt_snowflake_monitoring' -version: '5.3.0' +version: '5.3.1' config-version: 2 profile: dbt_snowflake_monitoring