From fca30332e2661875d5046ae740c1e758ea92c405 Mon Sep 17 00:00:00 2001 From: Yu Ishikawa Date: Fri, 22 Sep 2023 11:41:57 +0900 Subject: [PATCH] Fix to load dbt vars using `yaml` instead of `json` (#107) Signed-off-by: Yu Ishikawa --- src/dbt_osmosis/vendored/dbt_core_interface/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dbt_osmosis/vendored/dbt_core_interface/project.py b/src/dbt_osmosis/vendored/dbt_core_interface/project.py index 0e922e6..2f11b2b 100644 --- a/src/dbt_osmosis/vendored/dbt_core_interface/project.py +++ b/src/dbt_osmosis/vendored/dbt_core_interface/project.py @@ -28,6 +28,7 @@ import hmac import http.client as httplib import itertools +import yaml import json import logging import mimetypes @@ -269,10 +270,10 @@ def vars(self, v: Union[str, Dict[str, Any]]) -> None: """ if (__dbt_major_version__, __dbt_minor_version__) >= (1, 5): if isinstance(v, str): - v = json.loads(v) + v = yaml.safe_load(v) else: if isinstance(v, dict): - v = json.dumps(v) + v = yaml.dump(v) self._vars = v