potiuk commented on a change in pull request #22333:
URL: https://github.com/apache/airflow/pull/22333#discussion_r828850637
##########
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:
That's a good point. I think there is no real difference between
PendingDeprecationWarning and DeprecationWarning and seems that it's semantics
and meaning has been changed in the way to make PendingDeprecationWarning -
well - Deprecated :)
https://docs.python.org/3/library/exceptions.html#PendingDeprecationWarning
> This class is rarely used as emitting a warning about a possible upcoming
deprecation is unusual, and
[DeprecationWarning](https://docs.python.org/3/library/exceptions.html#DeprecationWarning)
is preferred for already active deprecations.
Should we change it everywhere in our code ? (or does it need a deprecation
to change PendingDeprecationWarning into 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]