This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new b5f74d0a483 [v3-1-test] Fix potential test failures on Py 3.13 against
reset_logging (#57417) (#58600)
b5f74d0a483 is described below
commit b5f74d0a4833a534d8574a81dc4f6b0011ec7c0b
Author: Amogh Desai <[email protected]>
AuthorDate: Mon Nov 24 00:32:38 2025 +0530
[v3-1-test] Fix potential test failures on Py 3.13 against reset_logging
(#57417) (#58600)
(cherry picked from commit 80585fb)
---
task-sdk/src/airflow/sdk/log.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/task-sdk/src/airflow/sdk/log.py b/task-sdk/src/airflow/sdk/log.py
index 6e0d280d2d7..6e81a96b254 100644
--- a/task-sdk/src/airflow/sdk/log.py
+++ b/task-sdk/src/airflow/sdk/log.py
@@ -248,8 +248,10 @@ def reset_logging():
from airflow.sdk._shared.logging.structlog import structlog_processors
global _warnings_showwarning
- warnings.showwarning = _warnings_showwarning
- _warnings_showwarning = None
+ if _warnings_showwarning is not None:
+ warnings.showwarning = _warnings_showwarning
+ _warnings_showwarning = None
+
structlog_processors.cache_clear()
logging_processors.cache_clear()