This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b9e96df0cd  Update log level to debug from warning about 
scheduled_duration metric (#38180)
b9e96df0cd is described below

commit b9e96df0cd00100795ad7d9c90d2f297123ae587
Author: Kazuhito Osabe <kzos...@coteries.co.jp>
AuthorDate: Wed Mar 27 17:02:40 2024 +0900

     Update log level to debug from warning about scheduled_duration metric 
(#38180)
    
    
    
    ---------
    
    Co-authored-by: Tzu-ping Chung <uranu...@gmail.com>
    Co-authored-by: Wei Lee <weilee...@gmail.com>
---
 airflow/models/taskinstance.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 9125e6912a..d326725a00 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -2391,8 +2391,10 @@ class TaskInstance(Base, LoggingMixin):
         elif new_state == TaskInstanceState.QUEUED:
             metric_name = "scheduled_duration"
             if self.start_date is None:
-                # same comment as above
-                self.log.warning(
+                # This check does not work correctly before fields like 
`scheduled_dttm` are implemented.
+                # TODO: Change the level to WARNING once it's viable.
+                # see #30612 #34493 and #34771 for more details
+                self.log.debug(
                     "cannot record %s for task %s because previous state 
change time has not been saved",
                     metric_name,
                     self.task_id,

Reply via email to