jscheffl commented on code in PR #61917:
URL: https://github.com/apache/airflow/pull/61917#discussion_r3068252965
##########
airflow-core/src/airflow/settings.py:
##########
@@ -681,6 +702,16 @@ def __getattr__(name: str):
from airflow.exceptions import RemovedInAirflow4Warning
+ if name == "SQL_ALCHEMY_CONN":
+ warnings.warn(
+ "settings.SQL_ALCHEMY_CONN has been replaced by
get_sql_alchemy_conn(). This shim is just for compatibility. "
+ "Please upgrade your provider or integration.",
+ RemovedInAirflow4Warning,
+ stacklevel=2,
+ )
+ return get_sql_alchemy_conn()
+ if name == "SQL_ALCHEMY_CONN_ASYNC":
+ return _AirflowSettings.sql_alchemy_conn_async
Review Comment:
applied, thanks.
##########
airflow-core/src/airflow/settings.py:
##########
@@ -439,14 +460,14 @@ def configure_orm(disable_connection_pool=False,
pool_class=None):
engine_args = prepare_engine_args(disable_connection_pool, pool_class)
connect_args = _get_connect_args("sync")
- if SQL_ALCHEMY_CONN.startswith("sqlite"):
+ if _AirflowSettings.sql_alchemy_conn.startswith("sqlite"):
# FastAPI runs sync endpoints in a separate thread. SQLite does not
allow
# to use objects created in another threads by default. Allowing that
in test
# to so the `test` thread and the tested endpoints can use common
objects.
connect_args["check_same_thread"] = False
engine = create_metadata_engine(
- SQL_ALCHEMY_CONN,
+ _AirflowSettings.sql_alchemy_conn,
Review Comment:
applied, thanks.
--
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]