summaryrefslogtreecommitdiff
path: root/oslo_db
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2021-07-16 19:02:50 +0100
committerStephen Finucane <stephenfin@redhat.com>2021-08-10 16:53:47 +0100
commit38c2effbf4a04158a7a79833099f168f5cfa5048 (patch)
treead7b6bf4d62614760efc69f3b5dc701288bba660 /oslo_db
parent6dc4b1c415bba34c875ad69dd5c01f804ae6f223 (diff)
downloadoslo-db-38c2effbf4a04158a7a79833099f168f5cfa5048.tar.gz
Replace use of update.values parameter
Resolve the following RemovedIn20Warning warning: The update.values parameter will be removed in SQLAlchemy 2.0. Please refer to the Update.values() method. Change-Id: I426605aa8f4332fd0b7d9f6fa0e97d7e02c7cbdc Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Diffstat (limited to 'oslo_db')
-rw-r--r--oslo_db/sqlalchemy/update_match.py6
-rw-r--r--oslo_db/tests/fixtures.py5
2 files changed, 3 insertions, 8 deletions
diff --git a/oslo_db/sqlalchemy/update_match.py b/oslo_db/sqlalchemy/update_match.py
index 577fb81..0bfcfa8 100644
--- a/oslo_db/sqlalchemy/update_match.py
+++ b/oslo_db/sqlalchemy/update_match.py
@@ -486,9 +486,9 @@ def _update_stmt_from_query(mapper, query, values):
)
primary_table = inspect(query.column_descriptions[0]['entity']).local_table
where_criteria = query.whereclause
- update_stmt = sql.update(primary_table,
- where_criteria,
- upd_values)
+ update_stmt = sql.update(
+ primary_table, where_criteria,
+ ).values(upd_values)
return update_stmt
diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py
index 528322a..53db930 100644
--- a/oslo_db/tests/fixtures.py
+++ b/oslo_db/tests/fixtures.py
@@ -59,11 +59,6 @@ class WarningsFixture(fixtures.Fixture):
warnings.filterwarnings(
'once',
- message=r'The update.values parameter will be removed .*',
- category=sqla_exc.SADeprecationWarning)
-
- warnings.filterwarnings(
- 'once',
message=r'The Engine.execute\(\) method is considered legacy .*',
category=sqla_exc.SADeprecationWarning)