Dev-iL commented on code in PR #52976: URL: https://github.com/apache/airflow/pull/52976#discussion_r2281411452
########## providers/postgres/src/airflow/providers/postgres/hooks/postgres.py: ########## @@ -36,20 +36,66 @@ from airflow.providers.common.sql.hooks.sql import DbApiHook from airflow.providers.postgres.dialects.postgres import PostgresDialect +USE_PSYCOPG3: bool +try: + import psycopg as psycopg # needed for patching in unit tests + import sqlalchemy + from packaging.version import Version + + sqlalchemy_version = Version(sqlalchemy.__version__) + is_sqla2 = (sqlalchemy_version.major, sqlalchemy_version.minor, sqlalchemy_version.micro) >= (2, 0, 0) + + USE_PSYCOPG3 = bool(psycopg) and is_sqla2 Review Comment: Fixed. -- 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]
