Skip to content

Commit

Permalink
conditions: _GSCReposition: fix already-valid warning message crash
Browse files Browse the repository at this point in the history
non-string node values caused a crash on warning
  • Loading branch information
kmantel committed Jun 26, 2024
1 parent f143014 commit 2b08075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph_scheduler/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3244,7 +3244,7 @@ def _validate_graph(self, graph):
self,
self.owner,
self._already_valid_message,
','.join(already_valid),
','.join([str(n) for n in already_valid]),
graph,
ignored_message,
)
Expand Down
5 changes: 5 additions & 0 deletions tests/scheduling/test_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

test_graphs = {
'five_node_hub': {'A': set(), 'B': set(), 'C': {'A', 'B'}, 'D': {'C'}, 'E': {'C'}},
'five_node_hub_ints': {1: set(), 2: set(), 3: {1, 2}, 4: {3}, 5: {3}},
'nine_node_multi': {
'A': set(),
'B': set(),
Expand Down Expand Up @@ -2011,6 +2012,10 @@ def _single_condition_test_helper(
'five_node_hub', 'C', ['D'], r'.*C is already before D.*Condition is ignored.',
{'A': set(), 'B': set(), 'C': {'A', 'B'}, 'D': {'C'}, 'E': {'C'}},
),
(
'five_node_hub_ints', 3, [4], r'.*3 is already before 4.*Condition is ignored.',
{1: set(), 2: set(), 3: {1, 2}, 4: {3}, 5: {3}},
),
pytest.param(
'five_node_hub', 'C', ['B', 'D'], r'.*C is already before D.*(?<!ignored.)$',
{'A': set(), 'B': {'C'}, 'C': {'A'}, 'D': {'C'}, 'E': {'B', 'C'}},
Expand Down

0 comments on commit 2b08075

Please sign in to comment.