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

Correct import for sqlalchemy.pool.StaticPool #1895

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

bendichter
Copy link
Contributor

I found this error with:

$ linkml-sqldb dump --help
Traceback (most recent call last):
  File "/Users/bendichter/opt/miniconda3/bin/linkml-sqldb", line 5, in <module>
    from linkml.utils.sqlutils import main
  File "/Users/bendichter/opt/miniconda3/lib/python3.9/site-packages/linkml/utils/sqlutils.py", line 21, in <module>
    from sqlalchemy import StaticPool, create_engine
ImportError: cannot import name 'StaticPool' from 'sqlalchemy' (/Users/bendichter/opt/miniconda3/lib/python3.9/site-packages/sqlalchemy/__init__.py)

It looks like the import pattern can be corrected. from sqlalchemy.pool import StaticPool works for me. I'm not sure why I am getting this error and it hasn't come up before. I have sqlalchemy 1.4.46 installed

Correct import for sqlalchemy.pool.StaticPool
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7978be5) 80.13% compared to head (3cf0451) 80.13%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1895   +/-   ##
=======================================
  Coverage   80.13%   80.13%           
=======================================
  Files         100      100           
  Lines       11475    11476    +1     
  Branches     2956     2956           
=======================================
+ Hits         9195     9196    +1     
  Misses       1734     1734           
  Partials      546      546           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cmungall cmungall left a comment

Choose a reason for hiding this comment

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

Very odd. Our unit tests only test sqla2, but I am pretty sure the original code worked when we are all on 1.4.x! Anyway, better to work on a broad range of versions

@cmungall cmungall merged commit 1b6ca53 into linkml:main Feb 10, 2024
10 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants