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/08/10 07:13:30 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #33270: Refactor: Simplify code in www

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


##########
airflow/www/views.py:
##########
@@ -3251,8 +3251,7 @@ def duration(self, dag_id: str, session: Session = NEW_SESSION):
                 y=scale_time_units(cumulative_y[task_id], cum_y_unit),
             )
 
-        dates = sorted({ti.execution_date for ti in task_instances})
-        max_date = max(ti.execution_date for ti in task_instances) if dates else None
+        max_date = max((ti.execution_date for ti in task_instances), default=None)

Review Comment:
   Begs the question why we needed to sort the dates in the first place. Leftover code maybe, who knows.



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