Skip to content

Commit

Permalink
Add conditional logic to allow for use of --empty flag
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbooke4 committed Oct 31, 2024
1 parent f198262 commit 621e429
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions models/staging/base/base_ga4__events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ with source as (
select
{{ ga4.base_select_source() }}
from {{ source('ga4', 'events') }}
where cast(left(replace(_table_suffix, 'intraday_', ''), 8) as int64) >= {{var('start_date')}}
{% if is_incremental() %}
and parse_date('%Y%m%d', left(replace(_table_suffix, 'intraday_', ''), 8)) in ({{ partitions_to_replace | join(',') }})
{% if not flags.EMPTY %}
where cast(left(replace(_table_suffix, 'intraday_', ''), 8) as int64) >= {{var('start_date')}}
{% if is_incremental() %}
and parse_date('%Y%m%d', left(replace(_table_suffix, 'intraday_', ''), 8)) in ({{ partitions_to_replace | join(',') }})
{% endif %}
{% endif %}
),
renamed as (
Expand Down

0 comments on commit 621e429

Please sign in to comment.