Skip to content

Commit 0bd1c82

Browse files
authored
Adding a backcompat warning layer for airflow.settings.MASK_SECRETS_IN_LOGS (#55712)
1 parent eabe6b8 commit 0bd1c82

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

airflow-core/src/airflow/settings.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,21 @@ def prepare_syspath_for_config_and_plugins():
633633
sys.path.append(PLUGINS_FOLDER)
634634

635635

636+
def __getattr__(name: str):
637+
"""Handle deprecated module attributes."""
638+
if name == "MASK_SECRETS_IN_LOGS":
639+
import warnings
640+
641+
warnings.warn(
642+
"settings.MASK_SECRETS_IN_LOGS has been removed. This shim returns default value of False. "
643+
"Use SecretsMasker.enable_log_masking(), disable_log_masking(), or is_log_masking_enabled() instead.",
644+
DeprecationWarning,
645+
stacklevel=2,
646+
)
647+
return False
648+
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
649+
650+
636651
def import_local_settings():
637652
"""Import airflow_local_settings.py files to allow overriding any configs in settings.py file."""
638653
try:

0 commit comments

Comments
 (0)