Skip to content

Commit ab17fd9

Browse files
committed
treat all column names as lowercase in manifest and catalog
1 parent 77e6dfb commit ab17fd9

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

dbt2looker/models.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ class DbtModel(DbtNode):
8282
columns: Dict[str, DbtModelColumn]
8383
tags: List[str]
8484

85+
@validator('columns')
86+
def case_insensitive_column_names(cls, v: Dict[str, DbtModelColumn]):
87+
return {
88+
name.lower(): column.copy(update={'name': column.name.lower()})
89+
for name, column in v.items()
90+
}
91+
8592

8693
class DbtManifestMetadata(BaseModel):
8794
adapter_type: str
@@ -120,6 +127,13 @@ class DbtCatalogNode(BaseModel):
120127
metadata: DbtCatalogNodeMetadata
121128
columns: Dict[str, DbtCatalogNodeColumn]
122129

130+
@validator('columns')
131+
def case_insensitive_column_names(cls, v: Dict[str, DbtCatalogNodeColumn]):
132+
return {
133+
name.lower(): column.copy(update={'name': column.name.lower()})
134+
for name, column in v.items()
135+
}
136+
123137

124138
class DbtCatalog(BaseModel):
125139
nodes: Dict[str, DbtCatalogNode]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dbt2looker"
3-
version = "0.6.3"
3+
version = "0.7.0"
44
description = "Generate lookml view files from dbt models"
55
authors = ["oliverlaslett <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)