Skip to content

Commit b820831

Browse files
committed
Fix: Support overriding of the quoting policy for dbt sources
1 parent e6d0e70 commit b820831

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

sqlmesh/dbt/manifest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ def _load_sources(self) -> None:
168168
)
169169

170170
source_config = SourceConfig(
171-
**source_config_dict,
172-
**source_dict,
173-
freshness=freshness.to_dict() if freshness else None,
171+
**{
172+
**source_dict,
173+
**source_config_dict,
174+
"freshness": freshness.to_dict() if freshness else None,
175+
}
174176
)
175177
self._sources_per_package[source.package_name][source_config.config_name] = (
176178
source_config

tests/dbt/test_manifest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ def test_manifest_helper(caplog):
115115
assert sources["streaming.order_items"].table_name == "order_items"
116116
assert sources["streaming.order_items"].schema_ == "raw"
117117

118+
assert all(s.quoting["identifier"] is False for s in sources.values())
119+
118120
assert sources["streaming.order_items"].freshness == {
119121
"warn_after": {"count": 10 if DBT_VERSION < (1, 9, 5) else 12, "period": "hour"},
120122
"error_after": {"count": 11 if DBT_VERSION < (1, 9, 5) else 13, "period": "hour"},

tests/fixtures/dbt/sushi_test/dbt_project.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ seeds:
3535
+post-hook:
3636
- '{{ log("post-hook") }}'
3737

38+
sources:
39+
+quoting:
40+
identifier: false
41+
3842
vars:
3943
top_waiters:limit: 10
4044
'top_waiters:revenue': "revenue"

0 commit comments

Comments
 (0)