Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@Daniel-Faber
Copy link
Contributor

@Daniel-Faber Daniel-Faber commented Dec 8, 2023

The used sqlalchemy.orm.mappers are deprecated in SQLAlchemy 2.0, alongside other breaking changes fixed in this PR.
Mainly we have to use sqlalchemy.orm.registry.map_imperatively instead of sqlalchemy.orm.mappers.
We can also re-use the mapper_registry to replace sqlalchemy.Metadata, see the docs: https://docs.sqlalchemy.org/en/20/orm/mapping_styles.html#imperative-mapping

Full Changelog fixing all breaking changes in SQLAlchemy 2.0:

  • Use sqlalchemy.sql.text when running sqlalchemy.orm.session.execute
  • Convert rows to dicts via row._asdict() instead of dict(r)
  • Use sqlalchemy.orm.registry.map_imperatively instead of sqlalchemy.orm.mappers
  • Optional: Use sqlalchemy.orm.registry.metadata instead of sqlalchemy.Metadata

hjwp added 30 commits February 23, 2021 16:37
@Daniel-Faber Daniel-Faber closed this by deleting the head repository Oct 15, 2025
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.