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

vatsrahul1001 pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-4-test by this push:
     new 47c17f54d0d [v3-4-test] fix stat timing (#72553) (#75459)
47c17f54d0d is described below

commit 47c17f54d0db3d9d6741ed43d87f2c879a2654f2
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Oct 24 16:08:57 2026 +0530

    [v3-4-test] fix stat timing (#72553) (#75459)
    
    (cherry picked from commit 01907e047f5ba28ab836b78e2b46af6805d4bdc1)
    
    Co-authored-by: Jeff(Wei-Hao) Lu <[email protected]>
---
 airflow-core/src/airflow/dag_processing/manager.py     | 2 +-
 airflow-core/tests/unit/dag_processing/test_manager.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/airflow-core/src/airflow/dag_processing/manager.py 
b/airflow-core/src/airflow/dag_processing/manager.py
index 343d72c5e00..a4a834b9ace 100644
--- a/airflow-core/src/airflow/dag_processing/manager.py
+++ b/airflow-core/src/airflow/dag_processing/manager.py
@@ -1868,7 +1868,7 @@ def process_parse_results(
         normalized_bundle = normalize_name_for_stats(bundle_name)
         stats.timing(
             "dag_processing.last_duration",
-            stat.last_duration,
+            timedelta(seconds=stat.last_duration),
             tags=prune_dict(
                 {"bundle_name": normalized_bundle, "file_name": file_name, 
"team_name": team_name}
             ),
diff --git a/airflow-core/tests/unit/dag_processing/test_manager.py 
b/airflow-core/tests/unit/dag_processing/test_manager.py
index 2a92835edba..322d7dd83da 100644
--- a/airflow-core/tests/unit/dag_processing/test_manager.py
+++ b/airflow-core/tests/unit/dag_processing/test_manager.py
@@ -2322,7 +2322,7 @@ class TestDagFileProcessorManager:
         last_runtime = manager._file_stats[file_info].last_duration
         statsd_timing_mock.assert_any_call(
             "dag_processing.last_duration",
-            last_runtime,
+            timedelta(seconds=last_runtime),
             tags={"bundle_name": bundle_name, "file_name": dag_filename[:-3]},
         )
 
@@ -4721,7 +4721,7 @@ class TestMultiTeamMetrics:
 
         mock_timing.assert_called_once_with(
             "dag_processing.last_duration",
-            1.5,
+            timedelta(seconds=1.5),
             tags={"bundle_name": "testing", "file_name": "dag", "team_name": 
"team_alpha"},
         )
 
@@ -4743,7 +4743,7 @@ class TestMultiTeamMetrics:
 
         mock_timing.assert_called_once_with(
             "dag_processing.last_duration",
-            1.5,
+            timedelta(seconds=1.5),
             tags={"bundle_name": "testing", "file_name": "dag"},
         )
 

Reply via email to