oslo.db/oslo_db
Mike Bayer af4b2263e4 Resolve SAWarning in Query.soft_delete()
We currently see a lot of warnings like this from
the soft_delete() method:

  sqlalchemy.exc.SAWarning: Evaluating non-mapped column expression
  'updated_at' onto ORM instances; this is a deprecated use case.
  Please make use of the actual mapped columns in ORM-evaluated
  UPDATE / DELETE expressions.

This is because the "evaluate" synchronization strategy would like
to search for objects and update them based on the UPDATE criteria
passed, however the columns given, literal_column('id'),
literal_column('updated_at'), are not mapped to anything. The
evaluator has to make a guess that the string contained in these
expressions should be matched to a mapped attribute on the given
entity and this guess was first removed in [1], then added back in
[2] with a warning (likely since oslo.db is invoking it).

This uses the actual entity-mapped column for the query rather
than the literal string column.

[1] https://docs.sqlalchemy.org/en/latest/changelog/changelog_12.html#change-b1e620dece39006ab44c47044e9a6fee
[2] https://docs.sqlalchemy.org/en/latest/changelog/changelog_12.html#change-dff3a469788c81a46440584406cb22be

Change-Id: I192e84ce757d12d33085a209dd58d8ea46fb90fb
Closes-Bug: #1814199
2019-02-01 11:57:40 -05:00
..
locale Imported Translations from Zanata 2018-03-01 06:16:38 +00:00
sqlalchemy Resolve SAWarning in Query.soft_delete() 2019-02-01 11:57:40 -05:00
tests Merge "Move warnings to their own module" 2018-10-30 03:35:54 +00:00
__init__.py Move files out of the namespace package 2014-12-24 13:28:48 +02:00
_i18n.py Update the documentation link 2017-08-23 14:46:27 +08:00
api.py Improve exponential backoff for wrap_db_retry 2018-04-13 09:26:12 +08:00
concurrency.py Remove log translations 2017-03-30 08:42:42 +08:00
exception.py Move warnings to their own module 2018-10-17 14:04:42 +01:00
options.py Deprecate min_pool_size 2018-04-30 15:39:13 +00:00
warning.py Move warnings to their own module 2018-10-17 14:04:42 +01:00