From 673784bfbaa56bf54dbf2fff115d1ed424c39baf Mon Sep 17 00:00:00 2001 From: sydneynotthecity Date: Fri, 1 Mar 2024 13:48:33 -0600 Subject: [PATCH] Adjust eho timing --- models/marts/enriched_history_operations.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/marts/enriched_history_operations.sql b/models/marts/enriched_history_operations.sql index ddefa85..7445022 100644 --- a/models/marts/enriched_history_operations.sql +++ b/models/marts/enriched_history_operations.sql @@ -36,7 +36,7 @@ with cast(batch_run_date as date) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 2 day) and date(closed_at) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) {% if is_incremental() %} - and cast(batch_run_date as date) >= date('{{ dbt_airflow_macros.ds() }}') -- batch run is the min bound of a batch + and cast(batch_run_date as date) >= date_sub(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) and date(closed_at) >= date_sub(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) {% endif %} ) @@ -77,7 +77,7 @@ with cast(batch_run_date as date) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 2 day) and date(closed_at) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) {% if is_incremental() %} - and cast(batch_run_date as date) >= date('{{ dbt_airflow_macros.ds() }}') -- batch run is the min bound of a batch + and cast(batch_run_date as date) >= date_sub(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) and date(closed_at) >= date_sub(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) {% endif %} ) @@ -206,7 +206,7 @@ with cast(batch_run_date as date) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 2 day) and date(closed_at) < date_add(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) {% if is_incremental() %} - and cast(batch_run_date as date) >= date('{{ dbt_airflow_macros.ds() }}') -- batch run is the min bound of a batch + and cast(batch_run_date as date) >= date_sub(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) and date(closed_at) >= date_sub(date('{{ dbt_airflow_macros.ds() }}'), interval 1 day) {% endif %}