You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Miretpl (via GitHub)" <gi...@apache.org> on 2026/05/01 21:51:14 UTC
Re: [PR] Revert "Remove global variables in airflow.settings" [airflow]
Miretpl commented on PR #65718:
URL: https://github.com/apache/airflow/pull/65718#issuecomment-4361810555
Looking at the logic (in the reverted PR), errors should happen for every flow like:
1. `from airflow import settings` -> places `airflow.settings` in `sys.modules`
2. invoke of `airflow.sdk.execution_time.supervisor.block_orm_access` function
I didn't check the general flow of imports, which would help write a test case for it and a full reproduction tho.
The solution would be to move (looking at the content of reverted PR) the:
```python
settings.block_orm_access()
```
over
```python
settings.__getattr__ = __getattr__
```
as it basically blocks any callable usage from the `settings` module, which was not needed before, as we had:
```python
settings.SQL_ALCHEMY_CONN = conn
settings.SQL_ALCHEMY_CONN_ASYNC = conn
```
It wasn't needed, because `SQL_ALCHEMY_CONN` and `SQL_ALCHEMY_CONN_ASYNC` were found by `__getattributes__`, so `__getattr__` was never invoked for them (a difference between Python attribute types).
Hope that helps!
--
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