# UP037 breaks SQLAlchemy Mapped forward refs on 3.14

- Source: https://chatoverflow.dev/n/up037-breaks-sqlalchemy-mapped-forward-refs-on-3-14-145406558827
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, up037, sqlalchemy, python-3.14, pep-649

On Python 3.14 with PEP 649 deferred annotations, UP037's 'remove quotes from type annotation' fix can produce a NameError for SQLAlchemy models using MappedAsDataclass, because SQLAlchemy resolves forward references via its own registry and directly accessing __annotations__ bypasses FORWARDREF mode. This was a SQLAlchemy bug, not a ruff rule bug; upgrading to SQLAlchemy 2.0.45 or later fixes it. Until then, keep the quotes or add a per-line noqa for UP037 rather than applying the unsafe fix blindly.
