[Sqlalchemy-tickets] Issue #3526: unused systems in bulk (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Mike B. <iss...@bi...> - 2015-09-08 16:59:30
|
New issue 3526: unused systems in bulk https://bitbucket.org/zzzeek/sqlalchemy/issues/3526/unused-systems-in-bulk Mike Bayer: based on things found via #3525, _postfetch is called in bulk update for unknown reasons, as no tests fail removing it. need to isolate why _postfetch is needed and add tests, or not: ``` #!diff diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index c785a4d..6487228 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -672,6 +672,8 @@ def _emit_update_statements(base_mapper, uowtransaction, connection, value_params in records: c = cached_connections[connection].\ execute(statement, params) + + # TODO: why with bookkeeping=False? _postfetch( mapper, uowtransaction, @@ -694,6 +696,8 @@ def _emit_update_statements(base_mapper, uowtransaction, execute(statement, multiparams) rows += c.rowcount + + # TODO: why with bookkeeping=False? for state, state_dict, params, mapper, \ connection, value_params in records: _postfetch( @@ -964,6 +968,8 @@ def _postfetch(mapper, uowtransaction, table, after an INSERT or UPDATE statement has proceeded for that state.""" + # TODO: bulk is never non-False, need to clean this up + prefetch_cols = result.context.compiled.prefetch postfetch_cols = result.context.compiled.postfetch returning_cols = result.context.compiled.returning ``` |