josh-fell commented on a change in pull request #20470:
URL: https://github.com/apache/airflow/pull/20470#discussion_r777031770



##########
File path: airflow/stats.py
##########
@@ -65,7 +65,7 @@ def gauge(cls, stat: str, value: float, rate: int = 1, delta: 
bool = False) -> N
         """Gauge stat"""
 
     @classmethod
-    def timing(cls, stat: str, dt: Union[float, datetime.timedelta]) -> None:
+    def timing(cls, stat: str, dt: Optional[Union[float, datetime.timedelta]]) 
-> None:

Review comment:
       If I move the `cast()` here we're golden:
   ```python
   for file_path in files_paths_to_queue:
               if file_path not in self._file_stats:
                   self._file_stats[file_path] = DagFileStat(
                       num_dags=0,
                       import_errors=0,
                       last_finish_time=None,
                       last_duration=cast(float, None),
                       run_count=0,
                   )
   ```
   Thanks for the tip @kaxil!




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


Reply via email to