Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

@amoghrajesh amoghrajesh commented Sep 16, 2025

Rare, but there is a chance that folks would use airflow.settings.MASK_SECRETS_IN_LOGS for some reason in their deployments.

This constant has been slayed and moved over to inside the SecretsMasker class now. Although it is not too important, but adding an informational warning for this would probably help.

Earlier:

Python 3.10.18 (main, Sep  8 2025, 22:04:00) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>>
>>> from airflow.settings
KeyboardInterrupt
>>> import airflow.settings
>>> settings.MASK_SECRETS_IN_LOGS
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'settings' is not defined
>>> airflow.settings.MASK_SECRET_IN_LOGS
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'airflow.settings' has no attribute 'MASK_SECRET_IN_LOGS'
>>> airflow.settings.MASK_SECRETS_IN_LOGS
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'airflow.settings' has no attribute 'MASK_SECRETS_IN_LOGS'
>>> exit()

Now:

root@f6f4a87fe6c4:/opt/airflow# python
Python 3.10.18 (main, Sep  8 2025, 22:04:00) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import airflow.settings
>>> airflow.settings.MASK_SECRETS_IN_LOGS
<stdin>:1 DeprecationWarning: settings.MASK_SECRETS_IN_LOGS has been removed. Use SecretsMasker.enable_log_masking(), disable_log_masking(), or is_log_masking_enabled() instead.
>>> import airflow.settings
KeyboardInterrupt
>>>
KeyboardInterrupt
>>> exit()
root@f6f4a87fe6c4:/opt/airflow# python
Python 3.10.18 (main, Sep  8 2025, 22:04:00) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import airflow.settings
>>> airflow.settings.MASK_SECRETS_IN_LOGS
<stdin>:1 DeprecationWarning: settings.MASK_SECRETS_IN_LOGS has been removed. This shim returns default value of False. Use SecretsMasker.enable_log_masking(), disable_log_masking(), or is_log_masking_enabled() instead.
False

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@amoghrajesh amoghrajesh requested a review from kaxil September 16, 2025 09:10
@amoghrajesh
Copy link
Contributor Author

I'd like to have this in 3.1 if possible as it is related to a compat thing.

@amoghrajesh amoghrajesh merged commit 0bd1c82 into apache:main Sep 17, 2025
60 checks passed
@amoghrajesh amoghrajesh deleted the compat-for-settings branch September 17, 2025 11:35
kaxil pushed a commit that referenced this pull request Sep 18, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants