You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/22 05:45:58 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #27953: Add timezone to dags in main screen

uranusjr commented on code in PR #27953:
URL: https://github.com/apache/airflow/pull/27953#discussion_r1055112051


##########
airflow/models/dag.py:
##########
@@ -3204,6 +3204,17 @@ def __init__(self, concurrency=None, **kwargs):
     def __repr__(self):
         return f"<DAG: {self.dag_id}>"
 
+    @property
+    def schedule_description(self) -> str | None:
+        if (
+            isinstance(self.schedule_interval, str)
+            and self.schedule_interval != "@once"
+            and self.timetable_description != DatasetTriggeredTimetable.description
+        ):
+            return str(self.schedule_interval) + " " + str(self.timezone.name)

Review Comment:
   This weird isinstance check makes me feel the entire logic should go into the timetable class, and we can continue to use `schedule_interval`.



-- 
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