Skip to content

Commit

Permalink
fix: unexpected dbt selection not supported (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
datnguye authored May 3, 2024
1 parent eef842d commit 25b56ad
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 175 deletions.
9 changes: 8 additions & 1 deletion dbterd/adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def evaluate_kwargs(self, **kwargs) -> dict:
select = list(kwargs.get("select")) or []
exclude = list(kwargs.get("exclude")) or []

self.__check_if_any_unsupported_selection(select, exclude)
if not kwargs.get("dbt"):
self.__check_if_any_unsupported_selection(select, exclude)

if command == "run":
if kwargs.get("dbt"):
logger.info(f"Using dbt project dir at: {dbt_project_dir}")
Expand All @@ -65,6 +67,10 @@ def evaluate_kwargs(self, **kwargs) -> dict:
)
select = self.__get_selection(**kwargs)
exclude = []
if not select:
select = [
"exact:none"
] # 'cause [] is all, so let's select nothing here

if kwargs.get("dbt_auto_artifacts"):
self.dbt.get_artifacts_for_erd()
Expand All @@ -84,6 +90,7 @@ def __check_if_any_unsupported_selection(
self, select: list = [], exclude: list = []
):
"""Throw an error if detected any supported selections
which are built-in in dbterd (not dbt)
Args:
select (list, optional): Select rules. Defaults to [].
Expand Down
Loading

0 comments on commit 25b56ad

Please sign in to comment.