From 7c80d247c459ca3f2e595222de47fd0803b2a26a Mon Sep 17 00:00:00 2001 From: Mike Knepper Date: Wed, 31 May 2023 16:29:47 -0500 Subject: [PATCH] Adjust JSON log locations --- src/gretel_trainer/relational/core.py | 3 +++ src/gretel_trainer/relational/json.py | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gretel_trainer/relational/core.py b/src/gretel_trainer/relational/core.py index 2baa9d3d..a22576d9 100644 --- a/src/gretel_trainer/relational/core.py +++ b/src/gretel_trainer/relational/core.py @@ -142,6 +142,9 @@ def _check_for_json( ) -> Optional[IngestResponseT]: json_cols = get_json_columns(data) if len(json_cols) > 0: + logger.info( + f"Detected JSON data in table `{table}`. Running JSON normalization." + ) return RelationalJson.ingest(table, primary_key, data, json_cols) def _add_rel_json_and_tables(self, table: str, rj_ingest: IngestResponseT) -> None: diff --git a/src/gretel_trainer/relational/json.py b/src/gretel_trainer/relational/json.py index a3c9ed5f..ff5aa763 100644 --- a/src/gretel_trainer/relational/json.py +++ b/src/gretel_trainer/relational/json.py @@ -174,14 +174,11 @@ def ingest( df: pd.DataFrame, json_columns: Optional[list[str]] = None, ) -> Optional[IngestResponseT]: - logger.debug(f"Checking table `{table_name}` for JSON columns") tables = _normalize_json([(table_name, df.copy())], [], json_columns) # If we created additional tables (from JSON lists) or added columns (from JSON dicts) if len(tables) > 1 or len(tables[0][1].columns) > len(df.columns): mappings = {name: sanitize_str(name) for name, _ in tables} - logger.info( - f"Found JSON data in table `{table_name}`, transformed into {len(mappings)} tables for modeling." - ) + logger.info(f"Transformed JSON into {len(mappings)} tables for modeling.") logger.debug(f"Invented table names: {list(mappings.values())}") rel_json = RelationalJson( original_table_name=table_name,