diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-04-06 11:39:15 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-04-09 09:15:52 -0400 |
| commit | 036cdbe7fb2d651ba5fbbc758c8584df011c8043 (patch) | |
| tree | 651aa5734525e5784a0f879b7752cbfd45fa4922 /lib/sqlalchemy/sql | |
| parent | 5abeee69e34d45796cdff0770f58f9104da74701 (diff) | |
| download | sqlalchemy-036cdbe7fb2d651ba5fbbc758c8584df011c8043.tar.gz | |
Raise informative exception for non-sortable PK
An informative exception is re-raised when a primary key value is not
sortable in Python during an ORM flush under Python 3, such as an ``Enum``
that has no ``__lt__()`` method; normally Python 3 raises a ``TypeError``
in this case. The flush process sorts persistent objects by primary key
in Python so the values must be sortable.
Change-Id: Ia186968982dcd1234b82f2e701fefa2a1668a7e4
Fixes: #4232
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index c02ece98a..573fda98f 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -1175,7 +1175,6 @@ class Enum(Emulated, String, SchemaType): two = 2 three = 3 - t = Table( 'data', MetaData(), Column('value', Enum(MyEnum)) |
