diff --git a/.changes/unreleased/Fixes-20230626-115838.yaml b/.changes/unreleased/Fixes-20230626-115838.yaml new file mode 100644 index 00000000000..03f07c4237d --- /dev/null +++ b/.changes/unreleased/Fixes-20230626-115838.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Move project_root contextvar into events.contextvars +time: 2023-06-26T11:58:38.965299-04:00 +custom: + Author: gshank + Issue: "7937" diff --git a/core/dbt/graph/selector_methods.py b/core/dbt/graph/selector_methods.py index 1950923ad7e..f553dfc18f7 100644 --- a/core/dbt/graph/selector_methods.py +++ b/core/dbt/graph/selector_methods.py @@ -328,7 +328,7 @@ def search(self, included_nodes: Set[UniqueId], selector: str) -> Iterator[Uniqu # get project root from contextvar project_root = get_project_root() if project_root: - root = Path(project_root()) + root = Path(project_root) else: root = Path.cwd() paths = set(p.relative_to(root) for p in root.glob(selector))