From 636d3e78bb22b663fe560fc0a9461c6585879fd1 Mon Sep 17 00:00:00 2001 From: forgash_ Date: Fri, 26 Apr 2024 11:13:56 -0600 Subject: [PATCH] upd gap test severity. Add manual filter to txs and receipts --- .../silver__streamline_receipts.sql | 19 +++++++++++------- .../silver__streamline_transactions.sql | 20 ++++++++++++------- tests/tests__streamline_block_gaps.sql | 3 +-- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/models/silver/streamline/silver__streamline_receipts.sql b/models/silver/streamline/silver__streamline_receipts.sql index 07f543e..9bf3609 100644 --- a/models/silver/streamline/silver__streamline_receipts.sql +++ b/models/silver/streamline/silver__streamline_receipts.sql @@ -21,15 +21,20 @@ WITH shards AS ( {{ ref('silver__streamline_shards') }} WHERE ARRAY_SIZE(receipt_execution_outcomes) > 0 - {% if var('IS_MIGRATION') %} + {% if var('MANUAL_FIX') %} AND - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '{{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }} hours' - FROM {{ this }} - ) + {{ partition_load_manual('no_buffer') }} {% else %} - AND {{ incremental_load_filter('_inserted_timestamp') }} + {% if var('IS_MIGRATION') %} + AND + _inserted_timestamp >= ( + SELECT + MAX(_inserted_timestamp) - INTERVAL '{{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }} hours' + FROM {{ this }} + ) + {% else %} + AND {{ incremental_load_filter('_inserted_timestamp') }} + {% endif %} {% endif %} ), flatten_receipts AS ( diff --git a/models/silver/streamline/silver__streamline_transactions.sql b/models/silver/streamline/silver__streamline_transactions.sql index 901c78c..152c876 100644 --- a/models/silver/streamline/silver__streamline_transactions.sql +++ b/models/silver/streamline/silver__streamline_transactions.sql @@ -20,15 +20,21 @@ WITH chunks AS ( {{ ref('silver__streamline_shards') }} WHERE chunk != 'null' - {% if var('IS_MIGRATION') %} + + {% if var('MANUAL_FIX') %} AND - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '{{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }} hours' - FROM {{ this }} - ) + {{ partition_load_manual('no_buffer') }} {% else %} - AND {{ incremental_load_filter('_inserted_timestamp') }} + {% if var('IS_MIGRATION') %} + AND + _inserted_timestamp >= ( + SELECT + MAX(_inserted_timestamp) - INTERVAL '{{ var('STREAMLINE_LOAD_LOOKBACK_HOURS') }} hours' + FROM {{ this }} + ) + {% else %} + AND {{ incremental_load_filter('_inserted_timestamp') }} + {% endif %} {% endif %} ), flatten_transactions AS ( diff --git a/tests/tests__streamline_block_gaps.sql b/tests/tests__streamline_block_gaps.sql index e434d57..b070693 100644 --- a/tests/tests__streamline_block_gaps.sql +++ b/tests/tests__streamline_block_gaps.sql @@ -1,6 +1,5 @@ {{ config( - error_if = '>=10', - warn_if = 'BETWEEN 1 AND 9', + severity = 'error', tags = ['gap_test'] ) }}