TypeAlias cannot be found in type_annotation_map #11370
Labels
bug
Something isn't working
near-term release
addition to the milestone which indicates this should be in a near-term release
orm - annotated declarative
issues with the new annotations-based declarative ORM approach
Milestone
Describe the bug
I have a
TypeAlias
that I'm trying to put intype_annotation_map
but SQLAlchemy can't seem to find it.(my naive understanding was that
Json
in the example would be looked up directly by hash in the annotation map)Optional link from https://docs.sqlalchemy.org which documents the behavior that is expected
No response
SQLAlchemy Version in Use
2.0.30
DBAPI (i.e. the database driver)
psycopg2
Database Vendor and Major Version
PostgreSQL 12
Python Version
3.10
Operating system
macOS
To Reproduce
Error
Additional context
There's still an error even if the TypeAlias is not self-referential:
but weirdly it works if
JsonPrimitive
doesn't haveNone
:(both of these types aren't very useful, so I would specify the JSONB explicitly in
mapped_column
, but I thought it's worth mentioning what I'd tried).The text was updated successfully, but these errors were encountered: