Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map_adapter_type_to_looker when column_type is None #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dbt2looker/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down