Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion task-sdk/src/airflow/sdk/execution_time/secrets_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,25 @@

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,
)


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)
Expand Down