From 6f6252d627460a3bdff8cfa525b803714382fccc Mon Sep 17 00:00:00 2001 From: RuslanBergenov Date: Mon, 29 Jul 2024 12:28:04 -0600 Subject: [PATCH] fix: table not configured for flattening --- cf/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cf/main.py b/cf/main.py index 71064e3..f0cc6e4 100644 --- a/cf/main.py +++ b/cf/main.py @@ -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", @@ -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,