From 683abae2ac07737f1b1cafe66e8a2edd0096b24f Mon Sep 17 00:00:00 2001 From: Agnes Kiss Date: Tue, 10 Dec 2024 19:21:55 +0000 Subject: [PATCH] Fix return_limits_from_model --- .../expected_return_limits_from_model_macro.sql | 4 ++-- macros/incrementalize/return_limits_from_model.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/models/unit_tests/test_return_limits_from_model_macro/expected_return_limits_from_model_macro.sql b/integration_tests/models/unit_tests/test_return_limits_from_model_macro/expected_return_limits_from_model_macro.sql index c02adaf6..567774f6 100644 --- a/integration_tests/models/unit_tests/test_return_limits_from_model_macro/expected_return_limits_from_model_macro.sql +++ b/integration_tests/models/unit_tests/test_return_limits_from_model_macro/expected_return_limits_from_model_macro.sql @@ -11,11 +11,11 @@ SELECT 'dummy_model_only_nulls', cast('9999-01-01 00:00:00.000' as {{ dbt.type_t UNION ALL SELECT 'dummy_model_standard', cast('2024-12-01 00:00:00.000' as {{ dbt.type_timestamp() }}) , cast('2024-12-02 00:00:00.000' as {{ dbt.type_timestamp() }}) UNION ALL -SELECT 'dummy_model_empty_with_lower_output_true', cast('1970-01-01 00:00:00.000' as {{ dbt.type_timestamp() }}), cast('1970-01-02 00:00:00.000' as {{ dbt.type_timestamp() }}) +SELECT 'dummy_model_empty_with_lower_output_true', cast('1999-01-01 00:00:00.000' as {{ dbt.type_timestamp() }}), cast('1999-01-02 00:00:00.000' as {{ dbt.type_timestamp() }}) UNION ALL SELECT 'dummy_model_empty_with_lower_output_false', cast('9999-01-01 00:00:00.000' as {{ dbt.type_timestamp() }}), cast('9999-01-02 00:00:00.000' as {{ dbt.type_timestamp() }}) UNION ALL -SELECT 'dummy_model_only_nulls_with_lower_output_true', cast('1970-01-01 00:00:00.000' as {{ dbt.type_timestamp() }}), cast('1970-01-02 00:00:00.000' as {{ dbt.type_timestamp() }}) +SELECT 'dummy_model_only_nulls_with_lower_output_true', cast('1999-01-01 00:00:00.000' as {{ dbt.type_timestamp() }}), cast('1999-01-02 00:00:00.000' as {{ dbt.type_timestamp() }}) UNION ALL SELECT 'dummy_model_only_nulls_with_lower_output_false', cast('9999-01-01 00:00:00.000' as {{ dbt.type_timestamp() }}), cast('9999-01-02 00:00:00.000' as {{ dbt.type_timestamp() }}) UNION ALL diff --git a/macros/incrementalize/return_limits_from_model.sql b/macros/incrementalize/return_limits_from_model.sql index 7de61939..11da375e 100644 --- a/macros/incrementalize/return_limits_from_model.sql +++ b/macros/incrementalize/return_limits_from_model.sql @@ -36,8 +36,8 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0 {% do exceptions.warn("Snowplow Warning: No data in "~this~" for date range from variables, please modify your run variables to include data if this is not expected.") %} {{ snowplow_utils.log_message("Snowplow Warning: *************") }} {% if lower_output %} - {% set lower_limit = snowplow_utils.cast_to_tstamp('0000-01-01 00:00:00') %} - {% set upper_limit = snowplow_utils.cast_to_tstamp('0000-01-02 00:00:00') %} + {% set lower_limit = snowplow_utils.cast_to_tstamp('1999-01-01 00:00:00') %} + {% set upper_limit = snowplow_utils.cast_to_tstamp('1999-01-02 00:00:00') %} {%- else -%} {# Default behaviour for incrementalization. This allows for bigquery to still run the same way the other warehouses do, but also ensures no data is processed #} {% set lower_limit = snowplow_utils.cast_to_tstamp('9999-01-01 00:00:00') %}