This is an automated email from the ASF dual-hosted git repository.
henry3260 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 01907e047f5 fix stat timing (#72553)
01907e047f5 is described below
commit 01907e047f5ba28ab836b78e2b46af6805d4bdc1
Author: Jeff(Wei-Hao) Lu <[email protected]>
AuthorDate: Fri Oct 23 14:24:24 2026 +0900
fix stat timing (#72553)
---
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"},
)