Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces the usage of postgres:// with postgresql:// #21205

Merged
merged 1 commit into from
Jan 30, 2022

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Jan 29, 2022

After releasing 3.4.4 we can finally migrate to SQLAlchemy 1.4,
however SQLAlchemy 1.4 removed the use of postgres:// as valid
specification for Postgres DB SQL (leaving only postgresql://)

Due to that we need to change:

  • postgres provider to return postgresql:// with get_db_uri()
  • fix a number of tests that expected postgres://

We cannot do much if someone uses postgres:// specification.
Technically it might be seen as breaking change, but this is not
an airflow breaking change and users could still use SQLAlchemy
1.3 to keep the old prefix, so we can introduce this change
in Airflow without raising the major version.

Details in the SQLAlchemy Changelog.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

UPDATING.md Show resolved Hide resolved
@potiuk
Copy link
Member Author

potiuk commented Jan 29, 2022

Yep. solved.

@potiuk potiuk closed this Jan 29, 2022
@potiuk potiuk reopened this Jan 29, 2022
@potiuk potiuk closed this Jan 29, 2022
@potiuk potiuk reopened this Jan 29, 2022
@mik-laj
Copy link
Member

mik-laj commented Jan 29, 2022

I found a note in changelog:

[postgresql] [removed] ¶

Remove support for deprecated engine URLs of the form postgres://; this has emitted a warning for many years and projects should be using postgresql://.

References: #4643

https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-3687655465c25a39b968b4f5f6e9170b

@potiuk
Copy link
Member Author

potiuk commented Jan 29, 2022

Cool. I was looking for it and did not find it before (but I did not look for a long time)!. Updating,

After releasing 3.4.4 we can finally migrate to SQLAlchemy 1.4,
however SQLAlchemy 1.4 removed the use of postgres:// as valid
specification for Postgres DB SQL (leaving only postgresql://)

Due to that we need to change:

* postgres provider to return postgresql:// with get_db_uri()
* fix a number of tests that expected postgres://

We cannot do much if someone uses postgres:// specification.
Technically it might be seen as breaking change, but this is not
an airflow breaking change and users could still use SQLAlchemy
1.3 to keep the old prefix, so we can introduce this change
in Airflow without raising the major version.

Details in the [SQLAlchemy Changelog](https://docs.sqlalchemy.org/en/14/changelog/changelog_14.html#change-3687655465c25a39b968b4f5f6e9170b).
@potiuk
Copy link
Member Author

potiuk commented Jan 29, 2022

Updated!

@potiuk potiuk closed this Jan 29, 2022
@potiuk potiuk reopened this Jan 29, 2022
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Jan 30, 2022
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@potiuk potiuk merged commit e07139a into apache:main Jan 30, 2022
@potiuk potiuk deleted the fix-sqlalchemy-postgresql branch January 30, 2022 11:50
potiuk added a commit to potiuk/airflow that referenced this pull request Jan 31, 2022
The recent release of FAB 3.4.4 has unblocked us from upgrading
SQLAlchemy to 1.4.* version. We wanted to do it for quite some
time however upgrading to 1.4.* of sqlalchemy and allowing our
users to use it for 2.2.4 is a bit risky.

We are fixing resulting "aftermath" in the main branch and as
of this commit there are two fixes merged and remaining MsSQL
problem. The MSSql problem does not affect 2.2.4 as MsSQL will
be available only starting from 2.3.0, however the two other
problems have shown that SQLAlchemy has a potential to break
things and we might want to test it more thoroughly before
releasing 2.3.0.

The problems in question are apache#21205 and apache#21228. Both were only
test problems but the indicate that there might be more hidden
issues involved.

In order to limit risks, this PR proposes to limit SQLAlchemy
for 2.2.* to < 1.4.0. This will allow to upgrade FAB and
related dependencies without opening up Airflow to upgrade to
SQLAlchemy 1.4 (yet).
potiuk added a commit that referenced this pull request Jan 31, 2022
The recent release of FAB 3.4.4 has unblocked us from upgrading
SQLAlchemy to 1.4.* version. We wanted to do it for quite some
time however upgrading to 1.4.* of sqlalchemy and allowing our
users to use it for 2.2.4 is a bit risky.

We are fixing resulting "aftermath" in the main branch and as
of this commit there are two fixes merged and remaining MsSQL
problem. The MSSql problem does not affect 2.2.4 as MsSQL will
be available only starting from 2.3.0, however the two other
problems have shown that SQLAlchemy has a potential to break
things and we might want to test it more thoroughly before
releasing 2.3.0.

The problems in question are #21205 and #21228. Both were only
test problems but the indicate that there might be more hidden
issues involved.

In order to limit risks, this PR proposes to limit SQLAlchemy
for 2.2.* to < 1.4.0. This will allow to upgrade FAB and
related dependencies without opening up Airflow to upgrade to
SQLAlchemy 1.4 (yet).
@potiuk potiuk linked an issue Feb 7, 2022 that may be closed by this pull request
jedcunningham pushed a commit that referenced this pull request Feb 10, 2022
The recent release of FAB 3.4.4 has unblocked us from upgrading
SQLAlchemy to 1.4.* version. We wanted to do it for quite some
time however upgrading to 1.4.* of sqlalchemy and allowing our
users to use it for 2.2.4 is a bit risky.

We are fixing resulting "aftermath" in the main branch and as
of this commit there are two fixes merged and remaining MsSQL
problem. The MSSql problem does not affect 2.2.4 as MsSQL will
be available only starting from 2.3.0, however the two other
problems have shown that SQLAlchemy has a potential to break
things and we might want to test it more thoroughly before
releasing 2.3.0.

The problems in question are #21205 and #21228. Both were only
test problems but the indicate that there might be more hidden
issues involved.

In order to limit risks, this PR proposes to limit SQLAlchemy
for 2.2.* to < 1.4.0. This will allow to upgrade FAB and
related dependencies without opening up Airflow to upgrade to
SQLAlchemy 1.4 (yet).
jedcunningham pushed a commit that referenced this pull request Feb 17, 2022
The recent release of FAB 3.4.4 has unblocked us from upgrading
SQLAlchemy to 1.4.* version. We wanted to do it for quite some
time however upgrading to 1.4.* of sqlalchemy and allowing our
users to use it for 2.2.4 is a bit risky.

We are fixing resulting "aftermath" in the main branch and as
of this commit there are two fixes merged and remaining MsSQL
problem. The MSSql problem does not affect 2.2.4 as MsSQL will
be available only starting from 2.3.0, however the two other
problems have shown that SQLAlchemy has a potential to break
things and we might want to test it more thoroughly before
releasing 2.3.0.

The problems in question are #21205 and #21228. Both were only
test problems but the indicate that there might be more hidden
issues involved.

In order to limit risks, this PR proposes to limit SQLAlchemy
for 2.2.* to < 1.4.0. This will allow to upgrade FAB and
related dependencies without opening up Airflow to upgrade to
SQLAlchemy 1.4 (yet).
@jedcunningham jedcunningham added the type:doc-only Changelog: Doc Only label Mar 1, 2022
@potiuk potiuk restored the fix-sqlalchemy-postgresql branch April 26, 2022 20:48
@potiuk potiuk deleted the fix-sqlalchemy-postgresql branch July 29, 2022 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers full tests needed We need to run full set of tests for this PR to merge kind:documentation type:doc-only Changelog: Doc Only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Postgres connection URI incompatible with SQLAlchemy >= 1.4.0b1
5 participants