You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/17 06:47:33 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #22333: Patch sql_alchemy_conn if old postgres scheme used

uranusjr commented on a change in pull request #22333:
URL: https://github.com/apache/airflow/pull/22333#discussion_r828800148



##########
File path: airflow/settings.py
##########
@@ -228,6 +229,19 @@ def configure_vars():
     global PLUGINS_FOLDER
     global DONOT_MODIFY_HANDLERS
     SQL_ALCHEMY_CONN = conf.get('core', 'SQL_ALCHEMY_CONN')
+
+    # as of sqlalchemy 1.4, scheme `postgres+psycopg2` must be replaced with `postgresql`
+    parsed = urlparse(SQL_ALCHEMY_CONN)
+    bad_scheme = 'postgres+psycopg2'
+    if parsed.scheme == bad_scheme:
+        warnings.warn(
+            f"Scheme for metadata sql alchemy connection is `{bad_scheme}`."
+            "As of sqlalchemy 1.4 this is no longer supported.  You must change "
+            "to `postgresql`",
+            PendingDeprecationWarning,

Review comment:
       Should this be `DeprecationWarning`?




-- 
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