From a4022a4e4f3bc556cd6aa771f19becb8d863d34e Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 9 Oct 2023 15:51:29 -0500 Subject: [PATCH 1/2] pass args as string --- dbt_meshify/dbt_projects.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbt_meshify/dbt_projects.py b/dbt_meshify/dbt_projects.py index 2960705..7a7fbae 100644 --- a/dbt_meshify/dbt_projects.py +++ b/dbt_meshify/dbt_projects.py @@ -320,12 +320,13 @@ def select_resources( ) -> Set[str]: """Select dbt resources using NodeSelection syntax""" args = [] + # import pdb; pdb.set_trace() if select: - args = ["--select", select] + args = ["--select", " ".join(select)] if exclude: - args.extend(["--exclude", exclude]) + args.extend(["--exclude", " ".join(exclude)]) if selector: - args.extend(["--selector", selector]) + args.extend(["--selector", " ".join(selector)]) results = self.dbt.ls(self.path, args, output_key=output_key) if output_key: From 301bb6da280258d9bd97787e4fc9a7483c092860 Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 9 Oct 2023 17:25:30 -0500 Subject: [PATCH 2/2] exception for when we explicitly pass a space delimited string --- dbt_meshify/dbt_projects.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dbt_meshify/dbt_projects.py b/dbt_meshify/dbt_projects.py index 7a7fbae..5c34b88 100644 --- a/dbt_meshify/dbt_projects.py +++ b/dbt_meshify/dbt_projects.py @@ -322,11 +322,15 @@ def select_resources( args = [] # import pdb; pdb.set_trace() if select: - args = ["--select", " ".join(select)] + args = ["--select", " ".join(select) if not isinstance(select, str) else select] if exclude: - args.extend(["--exclude", " ".join(exclude)]) + args.extend( + ["--exclude", " ".join(exclude) if not isinstance(exclude, str) else exclude] + ) if selector: - args.extend(["--selector", " ".join(selector)]) + args.extend( + ["--selector", " ".join(selector) if not isinstance(selector, str) else selector] + ) results = self.dbt.ls(self.path, args, output_key=output_key) if output_key: