Skip to content

Commit

Permalink
fix: table not configured for flattening
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanBergenov committed Jul 29, 2024
1 parent e36788f commit 6f6252d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def valid_dataset(self):

def flatten_nested_tables(self):
tables_config = self.config[self.dataset]["tables_to_flatten"]

logging.info(
f"table type is {self.table_type}")

if self.table_type == "pseudonymous_users":

tables = list(set(tables_config) & set(["pseudo_users",
Expand Down Expand Up @@ -622,6 +626,11 @@ def flatten_ga_data(event, context):
for table in tables:
flat_tables.append(f"flat_{table}")

if len(flat_tables) == 0:
logging.info(
f"{input_event.dataset}.{input_event.table_type}_{input_event.table_date_shard} is not configured for flattening. Exiting the function.")
return

logging.info(f"GA4 flattener is writing data to flat tables {flat_tables} in dataset {input_event.dataset} for date {input_event.table_date_shard}")

query = ga_source.build_full_query(sharded_output_required=sharded_output_required,
Expand Down

0 comments on commit 6f6252d

Please sign in to comment.