ashb commented on a change in pull request #20795:
URL: https://github.com/apache/airflow/pull/20795#discussion_r783786932
##########
File path: airflow/models/taskmixin.py
##########
@@ -114,6 +115,14 @@ class DAGNode(DependencyMixin, metaclass=ABCMeta):
def node_id(self) -> str:
raise NotImplementedError()
+ @property
+ def label(self) -> Optional[str]:
+ tg: Optional["TaskGroup"] = getattr(self, 'task_group', None)
+ 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 :]
Review comment:
This doesn't feel safe -- there are cases where there can be a dot in
the task_id. There _shouldn't_ be, but I cant guarantee it.
--
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]