From d446d8df1b2456c3444a4e0ebc0cb76ef03afac5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 23 Jan 2021 18:02:17 -0500 Subject: Remove errant assertion from unit of work Fixed ORM unit of work regression where an errant "assert primary_key" statement interferes with primary key generation sequences that don't actually consider the columns in the table to use a real primary key constraint, instead using :paramref:`_orm.mapper.primary_key` to establish certain columns as "primary". Also remove errant "identity" requirement which does not seem to represent any current backend and is applied to test/sql/test_defaults.py->AutoIncrementTest, but these tests work on all backends. Fixes: #5867 Change-Id: I4502ca5079d824d7b4d055194947aa1a00effde7 --- lib/sqlalchemy/orm/persistence.py | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index b57963eb3..42b787580 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -1222,7 +1222,6 @@ def _emit_insert_statements( ) primary_key = result.inserted_primary_key - assert primary_key for pk, col in zip( primary_key, mapper._pks_by_table[table] ): -- cgit v1.2.1