Skip to content

Commit d6ab2fb

Browse files
committed
Pass FreshnessThreshold objects instead of dicts
1 parent 9823473 commit d6ab2fb

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

sqlmesh/dbt/manifest.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,19 @@ def _load_all(self) -> None:
153153

154154
def _load_sources(self) -> None:
155155
for source in self._manifest.sources.values():
156-
config_source = _config(source)
157-
source_dict = source.to_dict()
158-
159156
# starting in dbt-core 1.9.5, freshness can be set in both source and source config
160-
config_source_freshness = config_source.pop("freshness", None)
161-
source_dict_freshness = source_dict.pop("freshness", None)
162-
freshness = merge_freshness(source_dict_freshness, config_source_freshness)
157+
freshness = merge_freshness(source.freshness, source.config.freshness)
158+
159+
config_source_dict = _config(source)
160+
config_source_dict.pop("freshness", None)
161+
162+
source_dict = source.to_dict()
163+
source_dict.pop("freshness", None)
163164

164165
source_config = SourceConfig(
165-
**config_source,
166+
**config_source_dict,
166167
**source_dict,
167-
freshness=freshness,
168+
freshness=freshness.to_dict() if freshness else None,
168169
)
169170
self._sources_per_package[source.package_name][source_config.config_name] = (
170171
source_config

0 commit comments

Comments
 (0)