From e0bfb9282405771008247f2a5ae0133b52fe8675 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Mon, 11 Sep 2023 14:35:05 +0100 Subject: [PATCH] refactor UnitTestDefinition.tags --- core/dbt/contracts/graph/nodes.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/core/dbt/contracts/graph/nodes.py b/core/dbt/contracts/graph/nodes.py index b0840b89f3a..8023ceb3e5f 100644 --- a/core/dbt/contracts/graph/nodes.py +++ b/core/dbt/contracts/graph/nodes.py @@ -43,8 +43,6 @@ from dbt.exceptions import ( ParsingError, ContractBreakingChangeError, - TagsNotListOfStringsError, - TagNotStringError, ) from dbt.events.types import ( SeedIncreased, @@ -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 # ====================================