You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "leeyspaul (via GitHub)" <gi...@apache.org> on 2026/05/02 18:05:46 UTC
Re: [PR] Mask DFP connection and variable responses [airflow]
leeyspaul commented on PR #65704:
URL: https://github.com/apache/airflow/pull/65704#issuecomment-4364415176
The CI failure started after this PR added `mask_secret()` calls to the `GetConnection` and `GetVariable` branches of `_handle_request()`.
That function already had an older function-local import in the later `MaskSecret` branch:
from airflow.sdk.log import mask_secret
In Python, an import inside a function is a local assignment for the entire function scope. Because of that later import, Python treated all `mask_secret` references in `_handle_request()` as local variables, including the new calls that appear before the import. Those earlier calls then failed with `UnboundLocalError`, and Ruff reported the same issue as `F823`.
I fixed it by removing the nested import and use the existing module-level `mask_secret` import consistently. I'm unsure why it passed first, but then later failed on merges. Something I will look into.
Sorry, this PR is now ready to merge. @o-nikolas @vincbeck @ferruzzi
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org