Skip to content

Commit

Permalink
add test for paths without path selector
Browse files Browse the repository at this point in the history
update GraphSelector doc string to include selectors
  • Loading branch information
micahVictoria committed Aug 14, 2024
1 parent afde3d3 commit 67cb56f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cosmos/dbt/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class GraphSelector:
+model_d+
2+model_e
model_f+3
+/path/to/model_g+
path:/path/to/model_h+
+tag:nightly
+config.materialized:view
https://docs.getdbt.com/reference/node-selection/graph-operators
"""
Expand Down
8 changes: 8 additions & 0 deletions tests/dbt/test_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ def test_select_nodes_by_select_path():
assert selected == expected


def test_select_nodes_with_slash_but_no_path_selector():
selected = select_nodes(project_dir=SAMPLE_PROJ_PATH, nodes=sample_nodes, select=["gen2/models"])
expected = {
parent_node.unique_id: parent_node,
}
assert selected == expected


def test_select_nodes_by_select_union():
selected = select_nodes(project_dir=SAMPLE_PROJ_PATH, nodes=sample_nodes, select=["tag:has_child", "tag:nightly"])
expected = {
Expand Down

0 comments on commit 67cb56f

Please sign in to comment.