Skip to content

Commit

Permalink
minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarSnowPlow committed Oct 3, 2024
1 parent caa42e6 commit 19f2e4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros/utils/return_limits_from_model.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This program is licensed to you under the Snowplow Personal and Academic License
and you may not use this file except in compliance with the Snowplow Personal and Academic License Version 1.0.
You may obtain a copy of the Snowplow Personal and Academic License Version 1.0 at https://docs.snowplow.io/personal-and-academic-license-1.0/
#}
{% macro return_limits_from_model(model, lower_limit_col, upper_limit_col, lower_output=False) -%} {# add comments #}
{% macro return_limits_from_model(model, lower_limit_col, upper_limit_col, lower_output=False) -%}

{# In case of not execute just return empty strings to avoid hitting database #}
{% if not execute %}
Expand Down Expand Up @@ -36,11 +36,11 @@ 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: *************") }}
{# This allows for bigquery to still run the same way the other warehouses do, but also ensures no data is processed #}
{# add comment here #}
{% 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') %}
{%- else -%}
{# Default behaviour for incrementalisation. 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') %}
{% set upper_limit = snowplow_utils.cast_to_tstamp('9999-01-02 00:00:00') %}
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions macros/utils/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ macros:
- name: upper_limit_col
type: string
description: The column to take the `max` of to get the upper limit
- name: lower_output
type: boolean
description: This changes the output to a low set date if true and high set date if false, in the event the function cannot find value but needs to set a value
- name: set_query_tag
description: '{{ doc("macro_set_query_tag") }}'
arguments:
Expand Down

0 comments on commit 19f2e4d

Please sign in to comment.