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>
This commit is contained in:
Stephen Finucane 2021-07-16 19:02:50 +01:00
parent 6dc4b1c415
commit 38c2effbf4
2 changed files with 3 additions and 8 deletions

View File

@ -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

View File

@ -57,11 +57,6 @@ class WarningsFixture(fixtures.Fixture):
message=r'Using non-integer/slice indices on Row is deprecated .*',
category=sqla_exc.SADeprecationWarning)
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 .*',