github-actions[bot] opened a new pull request, #72273:
URL: https://github.com/apache/airflow/pull/72273

   B023 catches the late-binding closure-over-loop-variable footgun where
   a function defined inside a loop captures the loop variable by
   reference, so every function in the resulting list sees the same
   (final) value — a classic silent-bug source in Python
   
(https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result).
   
   The one user-visible fix is in providers/standard/.../triggers/file.py,
   where the FileTrigger's os.walk lambda was dispatched to a worker
   thread via anyio.to_thread.run_sync while the outer glob iteration
   could advance, potentially walking the wrong path.
   
   The rest are pre-existing latent-bug or false-positive sites in a
   migration script, breeze translation helpers, sphinx extensions, a
   system-test example DAG, the SMTP OAuth2 auth callback, secrets_masker
   subclass compat shim, and two provider unit tests — fixed by binding
   the loop-derived variable as a default argument on the inner function
   or lambda.
   (cherry picked from commit af0a3770a687458a357cd8820cbda07918a90cda)
   
   Co-authored-by: Deepak kumar <[email protected]>
   Co-authored-by: Jarek Potiuk <[email protected]>


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to