From c3a136af0bb9e7d4a87e9522ccdfb013bfafc3c7 Mon Sep 17 00:00:00 2001 From: Romain Pennec Date: Sun, 5 Feb 2023 15:29:44 +0000 Subject: [PATCH] Fix map_adapter_type_to_looker when column_type is None --- dbt2looker/generator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbt2looker/generator.py b/dbt2looker/generator.py index 9b95438..54e0fee 100644 --- a/dbt2looker/generator.py +++ b/dbt2looker/generator.py @@ -196,9 +196,11 @@ def normalise_spark_types(column_type: str) -> str: def map_adapter_type_to_looker(adapter_type: models.SupportedDbtAdapters, column_type: str): + if column_type is None: + return None normalised_column_type = (normalise_spark_types(column_type) if adapter_type == models.SupportedDbtAdapters.spark.value else column_type).upper() looker_type = LOOKER_DTYPE_MAP[adapter_type].get(normalised_column_type) - if (column_type is not None) and (looker_type is None): + if looker_type is None: logging.warning(f'Column type {column_type} not supported for conversion from {adapter_type} to looker. No dimension will be created.') return looker_type