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

Compatibility Issue: singer-sdk 0.43.1 Requires SQLAlchemy > 2.0 Due to ObjectKind Usage #114

Open
Ronnos opened this issue Jan 29, 2025 · 6 comments

Comments

@Ronnos
Copy link

Ronnos commented Jan 29, 2025

After upgrading to singer sdk 0.43.1, we encountered a compatibility issue because of meltano/sdk@d3dcc8e

This change introduces the use of sqlalchemy.engine.reflection.ObjectKind, which requires SQLAlchemy 2.0+.

Currently, this package does not enforce sqlalchemy>=2.0, which leads to the following error when running with an older version of SQLAlchemy:

site-packages/singer_sdk/connectors/sql.py", line 998

AttributeError: module 'sqlalchemy.engine.reflection' has no attribute 'ObjectKind' 

Suggested Fix:

Please update pyproject.toml to explicitly require:
sqlalchemy >=2.0

@guusfrenken-wk
Copy link

The requirement of SQLAlchemy 2 seems to have been introduced in Singer SDK 0.43.0: https://github.com/meltano/sdk/pull/2797/files

@coetzeevs
Copy link

Hey - has anyone managed a work-around to this? I'm running into the same thing, using a clean local install using all latest versions available, per the docs, and I'm still getting this. Checking the libs in .meltano/extractors/tap-mysql/venv I can see it's still using sqlalchemy<2.0 hence the error as noted by @Ronnos. No other variants are working locally either.

I see there's a dependabot PR (#105) open since June last year to bump to 2.0.

As a hack I tried forcing the version by just copy-pasting the content of sqlalchemy from another virtual environment to the venv folder, but I end up with different errors, though related I suspect.

@visch
Copy link
Member

visch commented Feb 5, 2025

PRs are accepted if someone wants to do it!

@guusfrenken-wk
Copy link

@visch I will look into implementing SQLAlchemy 2.0 support and submit a PR if it works out

@coetzeevs
Copy link

#115 started something here. 3 tests still failing. Will continue with it in time, or please feel free to contribute to the branch. @visch @guusfrenken-wk

Haven't tried using this in a local project yet though, so relying on the tests for validity of the changes.

@guusfrenken-wk
Copy link

Apologies, me and @Ronnos intended to work on this during our current sprint at work but we had to prioritize other tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants