Skip to content

Commit 2736f02

Browse files
committed
feat: allow updating core args via dict directly
1 parent acab48f commit 2736f02

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/dbt_core_interface/project.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import typing as t
1818
import uuid
1919
from concurrent.futures import ThreadPoolExecutor
20-
from dataclasses import dataclass, field
20+
from dataclasses import asdict, dataclass, field
2121
from datetime import datetime
2222
from multiprocessing import get_context as get_mp_context
2323
from pathlib import Path
@@ -284,14 +284,14 @@ def args(self) -> DbtConfiguration:
284284
return self._args
285285

286286
@args.setter
287-
def args(self, value: DbtConfiguration) -> None:
287+
def args(self, value: DbtConfiguration | dict[str, t.Any]) -> None: # pyright: ignore[reportPropertyTypeMismatch]
288288
"""Set the args for the DbtProject instance and update runtime config."""
289+
if isinstance(value, dict):
290+
merged_args = asdict(self._args)
291+
merged_args.update(value)
292+
value = DbtConfiguration(**merged_args)
289293
set_from_args(value, None) # pyright: ignore[reportArgumentType]
290-
self.runtime_config = RuntimeConfig.from_args(value)
291-
self.__manifest_loader = ManifestLoader(
292-
self.runtime_config,
293-
self.runtime_config.load_dependencies(),
294-
)
294+
self.parse_project(reparse_configuration=True)
295295
self._args = value
296296

297297
@property

0 commit comments

Comments
 (0)