Skip to content

feat!: Support SQLAlchemy 2.0, backwards compatibility for 1.4.16+#920

Closed
sharoonthomas wants to merge 47 commits intogoogleapis:mainfrom
sharoonthomas:sqla2
Closed

feat!: Support SQLAlchemy 2.0, backwards compatibility for 1.4.16+#920
sharoonthomas wants to merge 47 commits intogoogleapis:mainfrom
sharoonthomas:sqla2

Conversation

@sharoonthomas
Copy link
Contributor

@sharoonthomas sharoonthomas commented Oct 31, 2023

This patch makes this library backward incompatible for versions of SQLAlchemy < 1.4.16.

Fixes #510

@sharoonthomas sharoonthomas requested a review from a team as a code owner October 31, 2023 18:45
@sharoonthomas sharoonthomas requested review from a team and GaoleMeng October 31, 2023 18:45
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. labels Oct 31, 2023
@nayaknishant nayaknishant requested review from nayaknishant and removed request for GaoleMeng October 31, 2023 18:46
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 1, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 1, 2023
@nayaknishant nayaknishant added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Nov 2, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 2, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 2, 2023
@nayaknishant nayaknishant added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 6, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 6, 2023
@nayaknishant nayaknishant added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 7, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 7, 2023
This patch makes this library backward incompatible for
versions of SQLAlchemy < 2.0.

Fixes googleapis#510
@sharoonthomas
Copy link
Contributor Author

Included another bugfix related to unnest which seems to be not looking at arg.type.impl

@nayaknishant nayaknishant added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 7, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 7, 2023
@@ -1 +0,0 @@
sqlalchemy>=1.4.13,<2.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 3.9, does it make sense to set a specific version, much as we did for 3.8?

if setup.py etc have the right minimum version of python, then it prolly doesn't matter. just trying to think of whether I am missing anything.

Copy link
Contributor

@kiraksi kiraksi Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems our minimum is 3.8 in setup.py under classifiers, should I add this constraint to 3.9 then? I don't think its necessary since we bumped our minimum version to >=1.4.16

def test_update(self):
t = self.tables.plain_pk
connection = config.db.connect()
# Had to pass in data as a dict object in 2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a comment for you. Is this supposed to be a comment for future readers?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I left the comment to justify the change I made to this compliance test

Copy link
Contributor

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kiraksi

This is looking good.
I have a few comments and questions.

I need to confirm what we wanna do about making this a prerelease.
What kind verbiage we might wanna add to something like the README.md.

Let's touch base on Tuesday about next steps.

@chalmerlowe
Copy link
Contributor

A pre-release version of python-bigquery-sqlalchemy has been released with coverage for 1.4 AND 2.0. based in part on the code in this PR.

Gonna close this PR as complete.

As feedback on the pre-release rolls in, we will update the above branch and ultimately merge with main when ready.

@kiraksi
Copy link
Contributor

kiraksi commented Jan 25, 2024

This PR is now a part of prerelease v1.11.0.dev0. Closing this again

@sharoonthomas
Copy link
Contributor Author

Thanks @kiraksi

Really appreciate your team's commitment to maintaining the SQLA dialect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLAlchemy 2.0 support

9 participants