Skip to content

Point mask_secret deprecation warning at the module it actually uses - #77524

Open
PCTEJA wants to merge 1 commit into
apache:mainfrom
PCTEJA:fix/airflow-70875-secrets-masker-warning
Open

PCTEJA wants to merge 1 commit into
apache:mainfrom
PCTEJA:fix/airflow-70875-secrets-masker-warning

Conversation

@PCTEJA

@PCTEJA PCTEJA commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the misleading deprecation warning in the airflow.sdk.execution_time.secrets_masker compatibility shim.

The shim warns users to move to airflow.sdk._shared.secrets_masker, but its own __getattr__ resolves mask_secret from airflow.sdk.log — and the two are not equivalent: airflow.sdk.log.mask_secret also notifies the supervisor process, while the _shared version only masks locally. Following the warning silently drops supervisor-side masking. This corrects the warning text and the module docstring to name airflow.sdk.log for mask_secret (and _shared for everything else), matching what the shim already does. __getattr__ is unchanged.

This revives #70883 by @bujjibabukatta, which was approved by a maintainer and the reporter but auto-closed as stale before it could be merged. The change here is identical to that PR except the new test now asserts the warning with an explicit DeprecatedImportWarning category and a full-message match, following the pytest.warns(...) convention used across the task-sdk tests. The test fails against the old warning text and passes with the fix.

closes: #70875


Was generative AI tooling used to co-author this PR?
  • Yes

Generated-by: GPT Astra following the guidelines.

I used GPT Astra only for inline code completion.

The deprecation shim at airflow.sdk.execution_time.secrets_masker tells users to move to airflow.sdk._shared.secrets_masker, but its own __getattr__ resolves mask_secret from airflow.sdk.log instead — and the two are not equivalent: the log version also notifies the supervisor, while the _shared version only masks locally. Anyone following the warning silently loses supervisor-side masking. This corrects the guidance to match what the shim already does; __getattr__ itself is unchanged.
@PCTEJA

PCTEJA commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@ashb The PR is ready to be reviewed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation warning for airflow.sdk.execution_time.secrets_masker points at the wrong module for mask_secret

1 participant