Skip to content

Commit

Permalink
fix: Add False as option in from-deps set-name config (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
hneiva authored Jan 6, 2025
1 parent 9b1b869 commit 17cb096
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/taskgraph/transforms/from_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
),
): Any(
None,
False,
*SET_NAME_MAP,
{Any(*SET_NAME_MAP): object},
),
Expand Down
21 changes: 21 additions & 0 deletions test/test_transforms_from_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ def assert_dont_set_name(tasks):
assert tasks[0]["name"] == "a-special-name"


def assert_dont_set_name_false(tasks):
handle_exception(tasks)
assert len(tasks) == 1
assert tasks[0]["name"] == "a-special-name"


def assert_set_name_strip_kind(tasks):
handle_exception(tasks)
assert len(tasks) == 2
Expand Down Expand Up @@ -187,6 +193,21 @@ def assert_group_by_all_with_fetch(tasks):
None,
id="dont_set_name",
),
pytest.param(
# task
{
"name": "a-special-name",
"from-deps": {
"group-by": "all",
"set-name": False,
},
},
# kind config
None,
# deps
None,
id="dont_set_name_false",
),
pytest.param(
# task
{
Expand Down

0 comments on commit 17cb096

Please sign in to comment.