summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2021-04-28 12:59:37 +0000
committerGerrit Code Review <review@openstack.org>2021-04-28 12:59:37 +0000
commit62657ed1fb9af7fd45bdfb767c942559ecf868e0 (patch)
treeebe9b486dabb58f53130bea4e221481803c90208
parent432ee2f34ecc5ec2582563f552fa4ba0cb1c2584 (diff)
parentf2a94b6f1a8d1c2274ff81ae9968d22a22fd8503 (diff)
downloadoslo-db-8.6.0.tar.gz
Merge "Don't use private API to get query criteria"8.6.0
-rw-r--r--oslo_db/sqlalchemy/update_match.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/oslo_db/sqlalchemy/update_match.py b/oslo_db/sqlalchemy/update_match.py
index 8e139e9..577fb81 100644
--- a/oslo_db/sqlalchemy/update_match.py
+++ b/oslo_db/sqlalchemy/update_match.py
@@ -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