Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ def topological_sort(self) -> list[DAGNode]:
if tg.node_id in graph_unsorted:
break
tg = tg.parent_group

if tg:
# We are already going to visit that TG
break
else:
del graph_unsorted[node.node_id]
graph_sorted.append(node)
Expand Down
34 changes: 17 additions & 17 deletions airflow-core/tests/unit/utils/test_task_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
EXPECTED_JSON = {
"children": [
{"id": "task1", "label": "task1", "operator": "EmptyOperator", "type": "task"},
{"id": "task5", "label": "task5", "operator": "EmptyOperator", "type": "task"},
{
"children": [
{
Expand Down Expand Up @@ -197,6 +196,7 @@
"tooltip": "",
"type": "task",
},
{"id": "task5", "label": "task5", "operator": "EmptyOperator", "type": "task"},
],
"id": None,
"is_mapped": False,
Expand Down Expand Up @@ -277,7 +277,6 @@ def test_task_group_to_dict_with_prefix(dag_maker):
expected_node_id = {
"children": [
{"id": "task1", "label": "task1"},
{"id": "task5", "label": "task5"},
{
"id": "group234",
"label": "group234",
Expand All @@ -299,6 +298,7 @@ def test_task_group_to_dict_with_prefix(dag_maker):
{"id": "group234.upstream_join_id", "label": ""},
],
},
{"id": "task5", "label": "task5"},
],
"id": None,
"label": "",
Expand Down Expand Up @@ -347,7 +347,6 @@ def task_5():
"id": None,
"children": [
{"id": "task_1"},
{"id": "task_5"},
{
"id": "group234",
"children": [
Expand All @@ -358,6 +357,7 @@ def task_5():
{"id": "group234.downstream_join_id"},
],
},
{"id": "task_5"},
],
}

Expand Down Expand Up @@ -403,7 +403,6 @@ def test_task_group_to_dict_sub_dag(dag_maker):
"id": None,
"children": [
{"id": "task1"},
{"id": "task5"},
{
"id": "group234",
"children": [
Expand All @@ -418,6 +417,7 @@ def test_task_group_to_dict_sub_dag(dag_maker):
{"id": "group234.upstream_join_id"},
],
},
{"id": "task5"},
],
}

Expand Down Expand Up @@ -478,16 +478,6 @@ def test_task_group_to_dict_and_dag_edges(dag_maker):
expected_node_id = {
"id": None,
"children": [
{
"id": "group_c",
"children": [
{"id": "group_c.task6"},
{"id": "group_c.task7"},
{"id": "group_c.task8"},
{"id": "group_c.upstream_join_id"},
{"id": "group_c.downstream_join_id"},
],
},
{
"id": "group_d",
"children": [
Expand All @@ -497,8 +487,6 @@ def test_task_group_to_dict_and_dag_edges(dag_maker):
],
},
{"id": "task1"},
{"id": "task10"},
{"id": "task9"},
{
"id": "group_a",
"children": [
Expand All @@ -516,6 +504,18 @@ def test_task_group_to_dict_and_dag_edges(dag_maker):
{"id": "group_a.downstream_join_id"},
],
},
{
"id": "group_c",
"children": [
{"id": "group_c.task6"},
{"id": "group_c.task7"},
{"id": "group_c.task8"},
{"id": "group_c.upstream_join_id"},
{"id": "group_c.downstream_join_id"},
],
},
{"id": "task10"},
{"id": "task9"},
],
}

Expand Down Expand Up @@ -784,7 +784,6 @@ def section_2(value):
node_ids = {
"id": None,
"children": [
{"id": "task_end"},
{"id": "task_start"},
{
"id": "section_1",
Expand All @@ -804,6 +803,7 @@ def section_2(value):
{"id": "section_1.downstream_join_id"},
],
},
{"id": "task_end"},
],
}

Expand Down
Loading