Skip to content

Commit

Permalink
treat all column names as lowercase in manifest and catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
owlas committed Apr 18, 2021
1 parent 77e6dfb commit ab17fd9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions dbt2looker/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit ab17fd9

Please sign in to comment.