]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
allow any key for naming_convention dict, typing is not possible
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 12 Sep 2023 12:01:54 +0000 (08:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 12 Sep 2023 16:50:19 +0000 (12:50 -0400)
commitfbafc24d21cb8f791e72daa28fb26557a41a8d30
tree6efde131f5e6558e2a4f07853ea32f52606c90d0
parent8aa575366cc671ba8b28f2603cc3ca3b675f868f
allow any key for naming_convention dict, typing is not possible

Fixed regression introduced in 2.0.20 via :ticket:`9600` fix which
attempted to add more formal typing to
:paramref:`_schema.MetaData.naming_convention`. This change prevented basic
naming convention dictionaries from passing typing and has been adjusted so
that a plain dictionary of strings for keys as well as dictionaries that
use constraint types as keys or a mix of both, are again accepted.

As part of this change, lesser used forms of the naming convention
dictionary are also typed, including that it currently allows for
``Constraint`` type objects as keys as well.

Fixes: #9284
Fixes: #10264
Change-Id: Ic6561dd65058e4de3a7a393295b9863fc065db13
doc/build/changelog/unreleased_20/10264.rst [new file with mode: 0644]
lib/sqlalchemy/sql/schema.py
test/sql/test_metadata.py
test/typing/plain_files/sql/schema.py