bbovenzi commented on code in PR #32268:
URL: https://github.com/apache/airflow/pull/32268#discussion_r1247021297
##########
airflow/utils/task_group.py:
##########
@@ -653,15 +653,21 @@ def task_group_to_dict(task_item_or_group):
"""
from airflow.models.abstractoperator import AbstractOperator
- if isinstance(task_item_or_group, AbstractOperator):
+ if isinstance(task := task_item_or_group, AbstractOperator):
+ setup_teardown_type = None
+ if task.is_setup is True:
+ setup_teardown_type = "setup"
+ elif task.is_teardown is True:
+ setup_teardown_type = "teardown"
return {
- "id": task_item_or_group.task_id,
+ "id": task.task_id,
"value": {
- "label": task_item_or_group.label,
- "labelStyle": f"fill:{task_item_or_group.ui_fgcolor};",
- "style": f"fill:{task_item_or_group.ui_color};",
+ "label": task.label,
+ "labelStyle": f"fill:{task.ui_fgcolor};",
+ "style": f"fill:{task.ui_color};",
"rx": 5,
"ry": 5,
+ "setupTeardownType": setup_teardown_type,
Review Comment:
Yeah exactly, that's consistent with the type file below.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]