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/12/01 08:23:40 UTC

[GitHub] [airflow] Acehaidrey commented on a change in pull request #19921: Add dag view to display dagrun history per dag level

Acehaidrey commented on a change in pull request #19921:
URL: https://github.com/apache/airflow/pull/19921#discussion_r759950400



##########
File path: airflow/utils/timezone.py
##########
@@ -184,3 +184,36 @@ def coerce_datetime(v: Union[None, dt.datetime, DateTime]) -> Optional[DateTime]
     if isinstance(v, DateTime):
         return v
     return pendulum.instance(v)
+
+
+def td_format(td_object: Union[None, dt.timedelta, float]):
+    """
+    Format a timedelta object or float into a readable string for time duration.
+    For example timedelta(seconds=3602) would become `1 hour 2 seconds`
+    """

Review comment:
       this is really creative. I did not know about this so thank you :) 




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