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

FIX: Adapt to SQLAlchemy 1.4+ #985

Merged
merged 4 commits into from
Apr 24, 2023
Merged

Conversation

effigies
Copy link
Collaborator

@effigies effigies commented Apr 24, 2023

Looking at executablebooks/jupyter-cache#93 (thanks for finding, @DimitriPapadopoulos!), our sqlalchemy issues may have been smaller than they seemed they were going to be. Let's see.

Closes #680.

@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.04 ⚠️

Comparison is base (df945f4) 83.41% compared to head (dc2c948) 83.37%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #985      +/-   ##
==========================================
- Coverage   83.41%   83.37%   -0.04%     
==========================================
  Files          38       38              
  Lines        4287     4290       +3     
  Branches     1100     1100              
==========================================
+ Hits         3576     3577       +1     
- Misses        515      517       +2     
  Partials      196      196              
Impacted Files Coverage Δ
bids/layout/models.py 92.35% <60.00%> (-0.53%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@effigies effigies changed the title FIX: Import declarative_base from correct location FIX: Adapt to SQLAlchemy 1.4+ Apr 24, 2023
@effigies effigies marked this pull request as ready for review April 24, 2023 13:46
@effigies
Copy link
Collaborator Author

Passing locally. Commits have informative messages.

try:
from sqlalchemy.orm import declarative_base
except ImportError: # sqlalchemy < 1.4
from sqlalchemy.ext.declarative import declarative_base
Copy link
Collaborator

Choose a reason for hiding this comment

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

sweet! Thank you @effigies . Since it is somewhat of an explicit "support old and new" - may be worth adding a CI run which would test with sqlalchemy 1.3.24 ?

or since it has been years since 1.4 release, just require >= 1.4?

Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos Apr 24, 2023

Choose a reason for hiding this comment

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

You'll have to wait for a new release of jupyter_cache that will restore support of sqlalchemy 1.3. Otherwise handle complex dependencies:

  • latest mist-nbjupyter_cache 0.6.0 ⇒sqlalchemy ≥ 1.4
  • sqlalchemy < 1.4⇒previous mist-nb or upcoming mist-nb that would pull upcoming jupyter_cache that would restore support for sqlalchemy 1.3.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've generally wanted an explicit test of minimum dependencies, but never got around to it. It seems bad to go from requiring <1.4 to >=1.4 in a single commit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I created #987 to add a min-requirements.txt file and test it. It is currently passing locally but failing with what is very likely an out-of-memory error on GHA. How about we continue this conversation there?

@effigies effigies merged commit 5f008df into bids-standard:master Apr 24, 2023
24 checks passed
@effigies effigies deleted the sqlalchemy2 branch April 24, 2023 21:55
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.

SQLAlchemy 1.4 migration
4 participants