You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2025/11/28 01:05:03 UTC

(airflow) branch v3-1-test updated: [v3-1-test] Mask secrets properly when using deprecated import path (#58662) (#58726)

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 9c26db94ca6 [v3-1-test] Mask secrets properly when using deprecated import path (#58662) (#58726)
9c26db94ca6 is described below

commit 9c26db94ca617f53d01d6e9491ccc4a3360a1716
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Fri Nov 28 02:04:55 2025 +0100

    [v3-1-test] Mask secrets properly when using deprecated import path (#58662) (#58726)
    
    (cherry picked from commit 0afe6d3e656927fea80f2d4a608603ae47e107d1)
    
    Co-authored-by: Amogh Desai <am...@gmail.com>
---
 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)