Skip to content

Commit

Permalink
refactor UnitTestDefinition.tags
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 11, 2023
1 parent bc20b9d commit e0bfb92
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions core/dbt/contracts/graph/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
from dbt.exceptions import (
ParsingError,
ContractBreakingChangeError,
TagsNotListOfStringsError,
TagNotStringError,
)
from dbt.events.types import (
SeedIncreased,
Expand Down Expand Up @@ -1081,16 +1079,8 @@ def depends_on_nodes(self):

@property
def tags(self) -> List[str]:
# TODO: refactor for reuse in TestBuilder.tags
tags = self.config.get("tags", [])
if isinstance(tags, str):
tags = [tags]
if not isinstance(tags, list):
raise TagsNotListOfStringsError(tags)
for tag in tags:
if not isinstance(tag, str):
raise TagNotStringError(tag)
return tags[:]
tags = self.config.tags
return [tags] if isinstance(tags, str) else tags

Check warning on line 1083 in core/dbt/contracts/graph/nodes.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/contracts/graph/nodes.py#L1082-L1083

Added lines #L1082 - L1083 were not covered by tests


# ====================================
Expand Down

0 comments on commit e0bfb92

Please sign in to comment.