From e24b8d2600d9cb4edcfc8a772c1a1c4e6ca1e858 Mon Sep 17 00:00:00 2001 From: RuslanBergenov Date: Sat, 9 Nov 2024 13:16:27 -0700 Subject: [PATCH] fix: intraday flattening --- cf/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cf/main.py b/cf/main.py index 0e19c26..9379ffb 100644 --- a/cf/main.py +++ b/cf/main.py @@ -99,7 +99,7 @@ def __init__(self, gcp_project, dataset, table_type, date_shard): if self.table_type == "pseudonymous_users" or self.table_type=="users": self.date_field_name = "`date`" - elif self.table_type == "events": + elif self.table_type == "events" or self.table_type == "events_intraday": self.date_field_name = "event_date" def source_table_is_intraday(self): @@ -128,7 +128,7 @@ def get_temp_table_query(self): qry = "" - if self.table_type == "events": + if self.table_type in ("events", "events_intraday" ): qry = f""" CREATE OR REPLACE TEMP TABLE temp_events AS ( @@ -664,7 +664,7 @@ def build_full_query(self, sharded_output_required=True, partitioned_output_requ assert len(list_of_flat_tables) >= 1, "At least 1 flat table needs to be included in the config file" query = "" - if self.table_type in ("events", "users"): + if self.table_type in ("events", "events_intraday", "users"): query += self.get_temp_table_query()