Kundan-CR7 opened a new issue, #64060:
URL: https://github.com/apache/airflow/issues/64060

   ### Apache Airflow version
   
   3.1.8
   
   ### If "Other Airflow 3 version" selected, which one?
   
   Issue observed in local development version (main branch)
   
   ### What happened?
   
   The function `Variable.check_for_write_conflict` exits prematurely due to a 
`return None`
   statement inside the loop iterating over secrets backends.
   
   Because of this, only the first backend is evaluated, and the remaining 
backends are skipped.
   
   This leads to incorrect behavior where potential conflicts in later backends 
are not detected.
   
   ### What you think should happen instead?
   
   The function should iterate over all configured secrets backends and only 
return after
   checking all of them.
   
   The `return None` should not be inside the loop, as it causes early 
termination.
   
   ### How to reproduce
   
   1. Configure multiple secrets backends.
   2. Ensure the first backend does not contain the variable.
   3. Ensure a later backend contains the variable.
   4. Call `Variable.check_for_write_conflict`.
   
   Expected:
   The function should detect the variable in the later backend.
   
   Actual:
   The function exits after the first backend and does not check subsequent 
backends.
   
   ### Operating System
   
   macOS
   
   ### Versions of Apache Airflow Providers
   
   Not relevant
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   Testing on local clone of Apache Airflow repository.
   
   ### Anything else?
   
   ### Root cause
   
   The issue is caused by a misplaced `return None` inside the loop:
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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