]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
default Enum name to None and don't remove given name
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 15 Jun 2023 22:34:57 +0000 (18:34 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Jun 2023 13:46:15 +0000 (09:46 -0400)
commita06d1526216f651f415e9aff56f8d7a725501dc8
tree83e0eec876431278326278e2e787c4b0343a9966
parent98401bdcf46c2d200be82e275961fc5678c9950c
default Enum name to None and don't remove given name

Fixed issue in support for the :class:`.Enum` datatype in the
:paramref:`_orm.registry.type_annotation_map` first added as part of
:ticket:`8859` where using a custom :class:`.Enum` with fixed configuration
in the map would fail to transfer the :paramref:`.Enum.name` parameter,
which among other issues would prevent PostgreSQL enums from working if the
enum values were passed as individual values.  Logic has been updated so
that "name" is transferred over, but also that the default :class:`.Enum`
which is against the plain Python `enum.Enum` class or other "empty" enum
won't set a hardcoded name of ``"enum"`` either.

Fixes: #9963
Change-Id: I36526dcb5443579fcd604b0c02bd1f02ca85a977
doc/build/changelog/unreleased_20/9963.rst [new file with mode: 0644]
lib/sqlalchemy/sql/sqltypes.py
test/orm/declarative/test_tm_future_annotations_sync.py
test/orm/declarative/test_typed_mapping.py