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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]