Skip to content

Commit

Permalink
Fix task_group tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi committed Apr 16, 2024
1 parent e6094c5 commit 327bb0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions airflow/utils/task_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,13 @@ def task_group_to_dict(task_item_or_group):

if isinstance(task := task_item_or_group, AbstractOperator):
setup_teardown_type = {}
is_mapped = isinstance(task, MappedOperator)
is_mapped = {}
if task.is_setup is True:
setup_teardown_type["setupTeardownType"] = "setup"
elif task.is_teardown is True:
setup_teardown_type["setupTeardownType"] = "teardown"
if isinstance(task, MappedOperator):
is_mapped["isMapped"] = True
return {
"id": task.task_id,
"value": {
Expand All @@ -696,7 +698,7 @@ def task_group_to_dict(task_item_or_group):
"style": f"fill:{task.ui_color};",
"rx": 5,
"ry": 5,
"isMapped": is_mapped,
**is_mapped,
**setup_teardown_type,
},
}
Expand Down

0 comments on commit 327bb0b

Please sign in to comment.