diff --git a/dbt2looker/models.py b/dbt2looker/models.py index 11e601d..7a8a72e 100644 --- a/dbt2looker/models.py +++ b/dbt2looker/models.py @@ -82,6 +82,13 @@ class DbtModel(DbtNode): columns: Dict[str, DbtModelColumn] tags: List[str] + @validator('columns') + def case_insensitive_column_names(cls, v: Dict[str, DbtModelColumn]): + return { + name.lower(): column.copy(update={'name': column.name.lower()}) + for name, column in v.items() + } + class DbtManifestMetadata(BaseModel): adapter_type: str @@ -120,6 +127,13 @@ class DbtCatalogNode(BaseModel): metadata: DbtCatalogNodeMetadata columns: Dict[str, DbtCatalogNodeColumn] + @validator('columns') + def case_insensitive_column_names(cls, v: Dict[str, DbtCatalogNodeColumn]): + return { + name.lower(): column.copy(update={'name': column.name.lower()}) + for name, column in v.items() + } + class DbtCatalog(BaseModel): nodes: Dict[str, DbtCatalogNode] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f85e992..dd654db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dbt2looker" -version = "0.6.3" +version = "0.7.0" description = "Generate lookml view files from dbt models" authors = ["oliverlaslett "] license = "MIT"