Merge "Don't use private API to get query criteria"

This commit is contained in:
Zuul 2021-04-28 12:59:37 +00:00 committed by Gerrit Code Review
commit 62657ed1fb

View File

@ -484,11 +484,10 @@ def _update_stmt_from_query(mapper, query, values):
mapper.column_attrs[key], value
) for key, value in values.items()
)
query = query.enable_eagerloads(False)
context = query._compile_context()
primary_table = context.statement.froms[0]
primary_table = inspect(query.column_descriptions[0]['entity']).local_table
where_criteria = query.whereclause
update_stmt = sql.update(primary_table,
context.whereclause,
where_criteria,
upd_values)
return update_stmt