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
- Configure multiple secrets backends.
- Ensure the first backend does not contain the variable.
- Ensure a later backend contains the variable.
- 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?
Code of Conduct
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_conflictexits prematurely due to areturn Nonestatement 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 Noneshould not be inside the loop, as it causes early termination.How to reproduce
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 Noneinside the loop:Are you willing to submit PR?
Code of Conduct