Dev-iL commented on code in PR #68496:
URL: https://github.com/apache/airflow/pull/68496#discussion_r3511179404
##########
airflow-core/src/airflow/settings.py:
##########
@@ -241,7 +241,7 @@ def load_policy_plugins(pm: pluggy.PluginManager):
def _get_async_conn_uri_from_sync(sync_uri):
- AIO_LIBS_MAPPING = {"sqlite": "aiosqlite", "postgresql": "asyncpg",
"mysql": "aiomysql"}
+ AIO_LIBS_MAPPING = {"sqlite": "aiosqlite", "postgresql": "psycopg_async",
"mysql": "aiomysql"}
Review Comment:
Great catch! Yes, this is indeed flawed.
Reproduced locally: airflow-core ships no Postgres driver, so with a new
core and a pre-#69089 provider (which installs `asyncpg` but not `psycopg`),
the derived `postgresql+psycopg_async://` URL raises `ModuleNotFoundError: No
module named 'psycopg'` at component startup.
I changed the approach to feature-detect via the existing `_USE_PSYCOPG3`
flag, which falls back to `asyncpg` when psycopg3 isn't installed. The
database-setup docs and the newsfragment were updated accordingly.
The breakage of older core is documented in the provider changelog note
(#69089): those deployments need the `asyncpg` extra or an explicitly
configured `sql_alchemy_conn_async`.
--
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]