Skip to content

Commit 4ac372e

Browse files
authored
Merge pull request #24 from epoch8/development
Model "attr__ga4_user__ga4_user_properties" has been fixed.
2 parents c0c25ae + 5d08359 commit 4ac372e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/anchor/ga4_user/attr__ga4_user__ga4_user_properties.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WITH t1 AS (
1919
SELECT
2020
PARSE_DATE('%Y%m%d', _TABLE_SUFFIX) AS ga4_date_partition,
2121
events.user_pseudo_id AS ga4_user_id,
22-
TIMESTAMP(DATETIME(TIMESTAMP_MICROS(events.event_timestamp)), '{{ env_var('DBT_PACKAGE_GA4__TIME_ZONE', '+00') }}') AS ga4_user_timestamp_updated,
22+
TIMESTAMP(DATETIME(TIMESTAMP_MICROS(events.event_timestamp)), '{{ env_var('DBT_PACKAGE_GA4__TIME_ZONE', '+00') }}') AS ga4_user_properties_timestamp_updated,
2323
ga4_user_properties.key AS ga4_user_properties_key,
2424
ga4_user_properties.value.string_value AS ga4_user_properties_string_value,
2525
ga4_user_properties.value.int_value AS ga4_user_properties_int_value,
@@ -32,7 +32,7 @@ WITH t1 AS (
3232
UNNEST(events.user_properties) AS ga4_user_properties
3333
WHERE
3434
_TABLE_SUFFIX NOT LIKE '%intraday%'
35-
AND DATE(TIMESTAMP_MICROS(events.event_timestamp)) < DATE(CURRENT_DATE())
35+
AND DATE(TIMESTAMP(DATETIME(TIMESTAMP_MICROS(events.event_timestamp)), '{{ env_var('DBT_PACKAGE_GA4__TIME_ZONE', '+00') }}')) < DATE(CURRENT_DATE())
3636
AND PARSE_DATE('%Y%m%d', _TABLE_SUFFIX) > DATE_SUB(DATE(CURRENT_DATE()), INTERVAL {{ env_var('DBT_PACKAGE_GA4__INTERVAL') }} DAY)
3737
AND events.stream_id IN UNNEST({{ env_var('DBT_PACKAGE_GA4__STREAM_ID') }})
3838

0 commit comments

Comments
 (0)