uranusjr commented on code in PR #38446:
URL: https://github.com/apache/airflow/pull/38446#discussion_r1540207364
##########
airflow/models/taskmixin.py:
##########
@@ -161,10 +161,16 @@ def node_id(self) -> str:
@property
def label(self) -> str | None:
+ from airflow.models.baseoperator import BaseOperator
+ from airflow.models.mappedoperator import MappedOperator
+
tg = self.task_group
if tg and tg.node_id and tg.prefix_group_id:
# "task_group_id.task_id" -> "task_id"
return self.node_id[len(tg.node_id) + 1 :]
+
+ if isinstance(self, (BaseOperator, MappedOperator)):
+ return self.task_display_name
return self.node_id
Review Comment:
Hmm... The task group situation is interesting. I think I’d prefer
subclassing `label` on BaseOperator and MappedOperator to always use the
display name as label instead. In a future release we can add better mechanism
on the group level to handle this.
--
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]