You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/07/04 07:33:17 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #31852: [Webserver] Use custom_operator_name instead of task_type in UI for taskinstance object
uranusjr commented on code in PR #31852:
URL: https://github.com/apache/airflow/pull/31852#discussion_r1251616707
##########
airflow/models/taskinstance.py:
##########
@@ -617,6 +619,11 @@ def prev_attempted_tries(self) -> int:
def next_try_number(self) -> int:
return self._try_number + 1
+ @property
+ def operator_name(self) -> str:
+ """@property: use a more friendly display name for the operator, if set."""
+ return self.custom_operator_name or self.operator # type: ignore
Review Comment:
Let’s add a `or ""` at the end just to be safe. Leaking `None` here can be pretty problematic.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org