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

SQLAlchemy 2.0 migration #240

Open
3 tasks
AlexDo1 opened this issue Jan 27, 2023 · 1 comment
Open
3 tasks

SQLAlchemy 2.0 migration #240

AlexDo1 opened this issue Jan 27, 2023 · 1 comment
Assignees
Labels
model This issue is affecting the database model priority low

Comments

@AlexDo1
Copy link
Collaborator

AlexDo1 commented Jan 27, 2023

SQLAlchemy 2.0 was released, introducing a lot of breaking changes.
We need to adapt metacatalog where SQLAlchemy is used to make metacatalog compatible to SQLAlchemy 2.0.
There is an official migration guide by SQLAlchemy: https://docs.sqlalchemy.org/en/14/changelog/migration_20.html

Important:

  • Turn on RemovedIn20Warnings to give warnings when code is not compatible to SQLAlchemy 2.0
  • use SQLAlchemy 1.4.10 with RemovedIn20Warnings and fix all of the warnings.

Currently (27.01.2023), pandas is also not compatible to SQLAlchemy 2.0, as described in this issue: pandas-dev/pandas#40686.

  • update database revision
  • get rid of all Session.bind usages
  • ...
@mmaelicke
Copy link
Member

Beside the use of Session.bind in pandas, I think we should be able to substitute all usages of:

with engine.connect() as con:
    con.execute(...)

with:

session.execute(...)

In the older versions there have been differences how the transaction is handled, we need to check the changelog to see if that is still the case in 2.0 and how it affects our code.

@mmaelicke mmaelicke added priority low model This issue is affecting the database model labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model This issue is affecting the database model priority low
Projects
None yet
Development

No branches or pull requests

2 participants