trinodb / trino-python-client

Python client for Trino
Apache License 2.0
307 stars 151 forks source link

Update setup.py #353

Closed GitToby closed 1 year ago

GitToby commented 1 year ago

Description

Limit the sqlachemy version requires to sidestep pandas+sqlalchemy>2.0.0 issues with pd.read_sql(), pd.read_sql_table() and pd.read_sql_query(). See #352

Non-technical explanation

Installing trino[sqlalchemy] installs a version that breaks methods such as pd.read_sql() and pd.read_sql_table(). This will limit the sqlalchemy version to sidestep these bugs.

Release notes

( ) This is not user-visible or docs only and no release notes are required. ( ) Release notes are required, please propose a release note for me. (x) Release notes are required, with the following suggested text:

Limit the sqlachemy version requires to sidestep pandas+sqlalchemy>2.0.0 issues with `pd.read_sql()`, `pd.read_sql_table()` and `pd.read_sql_query()`. ({Installing trino[sqlalchemy] wont allow pandas.read_sql}`#352`)
cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

mdesmet commented 1 year ago

Hi @GitToby, we actually want to be compatible with sqlalchemy 2.0.0. What is exactly the issue that you are facing?

GitToby commented 1 year ago

see issue #352 - ultimately this is an issue due to the bug in pandas where pandas 1.5.x doesn't work with sqlalchemy>2.0.0 because of a change in API. The default trio[sqlalchemy] install will hence fail when calling the pandas methods that leverage sqlalchemy tools.

hashhar commented 1 year ago

This is something Pandas fixed in their 2.0 release. It should be improved upstream in Pandas (or by the user by pinning a specific version) in case of incompatibilities. This client itself works with SQLA 2.x fine so no changes need to be done here.