From 1f0247f43d70753466abf3c4eaca4245442b27e3 Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Mon, 22 May 2023 12:25:33 -0400 Subject: [PATCH 1/3] Stringify paths in flags --- core/dbt/flags.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/dbt/flags.py b/core/dbt/flags.py index a87c9e8d37e..c40436e37b5 100644 --- a/core/dbt/flags.py +++ b/core/dbt/flags.py @@ -95,6 +95,8 @@ def get_flag_dict(): def get_flag_obj(): new_flags = Namespace() for key, val in get_flag_dict().items(): + if isinstance(val, Path): + val = str(val) setattr(new_flags, key.upper(), val) # The following 3 are CLI arguments only so they're not full-fledged flags, # but we put in flags for users. From 66745f133d1838f9fdf81ba08039af34cc25e5bc Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Mon, 22 May 2023 13:50:13 -0400 Subject: [PATCH 2/3] Changie --- .changes/unreleased/Fixes-20230522-135007.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixes-20230522-135007.yaml diff --git a/.changes/unreleased/Fixes-20230522-135007.yaml b/.changes/unreleased/Fixes-20230522-135007.yaml new file mode 100644 index 00000000000..bef33d2fa30 --- /dev/null +++ b/.changes/unreleased/Fixes-20230522-135007.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Stringify flag paths for Jinja context +time: 2023-05-22T13:50:07.897354-04:00 +custom: + Author: gshank + Issue: "7495" From b2dbc403ecf31d29760802b7737389b9ffdd6b79 Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Mon, 22 May 2023 14:53:42 -0400 Subject: [PATCH 3/3] mising import --- core/dbt/flags.py | 1 + 1 file changed, 1 insertion(+) diff --git a/core/dbt/flags.py b/core/dbt/flags.py index c40436e37b5..37462659c97 100644 --- a/core/dbt/flags.py +++ b/core/dbt/flags.py @@ -3,6 +3,7 @@ from argparse import Namespace from multiprocessing import get_context from typing import Optional +from pathlib import Path # for setting up logger for legacy logger