-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix initial dbt compile error (Close #69)
- Loading branch information
1 parent
5204001
commit 63d5209
Showing
4 changed files
with
116 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
{% macro get_session_lookback_limit(lower_limit) %} | ||
|
||
{% if not execute %} | ||
{{ return('')}} | ||
{% endif %} | ||
|
||
{% set limit_query %} | ||
select | ||
{{ snowplow_utils.timestamp_add( | ||
'day', | ||
-var("snowplow__session_lookback_days", 365), | ||
lower_limit) }} as session_lookback_limit | ||
{% if lower_limit == '' %} | ||
|
||
{% endset %} | ||
{% do exceptions.warn("Snowplow Warning: Macro get_session_lookback_limit lower_limit argument == ''. This is expected if you are compiling a fresh installation of the dbt-snowplow-* packages.") %} | ||
|
||
{% set results = run_query(limit_query) %} | ||
|
||
{% if execute %} | ||
{{ return('')}} | ||
|
||
{% set session_lookback_limit = snowplow_utils.cast_to_tstamp(results.columns[0].values()[0]) %} | ||
{% else %} | ||
|
||
{{ return(session_lookback_limit) }} | ||
{% set limit_query %} | ||
select | ||
{{ snowplow_utils.timestamp_add( | ||
'day', | ||
-var("snowplow__session_lookback_days", 365), | ||
lower_limit) }} as session_lookback_limit | ||
|
||
{% endif %} | ||
{% endset %} | ||
|
||
{% set results = run_query(limit_query) %} | ||
|
||
{% if execute %} | ||
|
||
{% set session_lookback_limit = snowplow_utils.cast_to_tstamp(results.columns[0].values()[0]) %} | ||
|
||
{{ return(session_lookback_limit) }} | ||
|
||
{% endif %} | ||
|
||
{% endif %} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters