This is an automated email from the ASF dual-hosted git repository.
amoghdesai 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 0afe6d3e656 Mask secrets properly when using deprecated import path
(#58662)
0afe6d3e656 is described below
commit 0afe6d3e656927fea80f2d4a608603ae47e107d1
Author: Amogh Desai <[email protected]>
AuthorDate: Wed Nov 26 19:55:41 2025 +0530
Mask secrets properly when using deprecated import path (#58662)
---
task-sdk/src/airflow/sdk/execution_time/secrets_masker.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/task-sdk/src/airflow/sdk/execution_time/secrets_masker.py
b/task-sdk/src/airflow/sdk/execution_time/secrets_masker.py
index 80e711fa3fc..7d04b6af29a 100644
--- a/task-sdk/src/airflow/sdk/execution_time/secrets_masker.py
+++ b/task-sdk/src/airflow/sdk/execution_time/secrets_masker.py
@@ -27,10 +27,13 @@ from __future__ import annotations
import warnings
+# Note: This import from airflow-core is ok, as this is a compatibility module
which we will remove in 3.2 anyways
+from airflow.utils.deprecation_tools import DeprecatedImportWarning
+
warnings.warn(
"Importing from 'airflow.sdk.execution_time.secrets_masker' is deprecated
and will be removed in a future version. "
"Please use 'airflow.sdk._shared.secrets_masker' instead.",
- DeprecationWarning,
+ DeprecatedImportWarning,
stacklevel=2,
)
@@ -38,6 +41,11 @@ warnings.warn(
def __getattr__(name: str):
"""Dynamically import attributes from the shared secrets_masker
location."""
try:
+ if name == "mask_secret":
+ from airflow.sdk.log import mask_secret
+
+ return mask_secret
+
import airflow.sdk._shared.secrets_masker as new_module
return getattr(new_module, name)