]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
re-process args for builtin generic types
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 31 Aug 2024 16:56:00 +0000 (12:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Sep 2024 20:42:52 +0000 (16:42 -0400)
commit42ec1f70138d51dd7e61578453faa0f4d47f6ec3
treed1ed7935198b57f9e0f3439e51553ff83d2e06b4
parent967274cda403c00ee8d0dfa5115afa3895b3730d
re-process args for builtin generic types

Improvements to the ORM annotated declarative type map lookup dealing with
composed types such as ``dict[str, Any]`` linking to JSON (or others) with
or without "future annotations" mode.

There's apparently a big incompatiblity in types from typing vs.
Python builtins in the way they genericize.   The typing library makes
it very difficult to distinguish between the two sets of types.  This
patch is a bit slash and burn to work around all this.   These should
likely be reported as bugs in the Python standard library if they
aren't already.

Fixes: #11814
Change-Id: I56a62701d5e883be04df7f45fd9429bb9c1c9a6f
(cherry picked from commit f746fd78e303352d426a15c1f76ee835ce399d44)
doc/build/changelog/unreleased_20/11814.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_base.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/util/typing.py
test/orm/declarative/test_tm_future_annotations_sync.py
test/orm/declarative/test_typed_mapping.py