Skip to content

Commit

Permalink
Remove "tags:" prefix from model config selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshimaru46 committed Dec 12, 2024
1 parent 110fb07 commit 53f1083
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cosmos/dbt/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ def load_via_custom_parser(self) -> None:
for model_name, model in models:
config = {item.split(":")[0]: item.split(":")[-1] for item in model.config.config_selectors}
tags = [selector for selector in model.config.config_selectors if selector.startswith("tags:")]
# Remove the "tags:" prefix
tags = [tag.split(":")[-1] for tag in tags]
node = DbtNode(
unique_id=f"{model.type.value}.{self.project.project_name}.{model_name}",
resource_type=DbtResourceType(model.type.value),
Expand Down
2 changes: 1 addition & 1 deletion tests/dbt/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def test_load_via_load_via_custom_parser_select_rendering_config():
assert model_name == "customers"
filter_node = dbt_graph.filtered_nodes.get(model_name)
assert filter_node.file_path == DBT_PROJECTS_ROOT_DIR / "jaffle_shop/models/customers.sql"
assert filter_node.tags == ["tags:customers"]
assert filter_node.tags == ["customers"]


@patch("cosmos.dbt.graph.DbtGraph.update_node_dependency", return_value=None)
Expand Down

0 comments on commit 53f1083

Please sign in to comment.