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 2021/07/13 20:31:58 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #16931: #16692 show cron description in UI

uranusjr commented on a change in pull request #16931:
URL: https://github.com/apache/airflow/pull/16931#discussion_r669088674



##########
File path: airflow/www/views.py
##########
@@ -619,6 +619,9 @@ def index(self):
                     dag.can_edit = (permissions.ACTION_CAN_EDIT, dag_resource_name) in user_permissions
                 dag.can_trigger = dag.can_edit and can_create_dag_run
                 dag.can_delete = can_delete_dag
+                dag.schedule_interval_description = wwwutils.get_schedule_interval_description(
+                    dag.schedule_interval
+                )

Review comment:
       It’s better to incorporate this into the timetable model, something like `dag.timetable.description` (perhaps as a `@property`). This avoids the `if type(schedule_interval)` check, which is generally a code smell (should use polymorphism instead), and allows future custom timetables (proposed in [AIP-39](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-39+Richer+scheduler_interval)) to also provide a nice description to show in UI.




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