OpenStack Common DB Code
Go to file
Mike Bayer ddc4129a6d 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
(cherry picked from commit af4b2263e4)
2019-03-07 12:48:52 +00:00
doc List PyMySQL first in installation docs 2018-04-24 14:20:12 +00:00
oslo_db Resolve SAWarning in Query.soft_delete() 2019-03-07 12:48:52 +00:00
releasenotes Imported Translations from Zanata 2018-03-01 06:16:38 +00:00
tools Remove tox_install.sh and align constraints consumption 2018-03-08 09:46:24 -06:00
.coveragerc Fix coverage configuration and execution 2015-10-08 17:29:42 -04:00
.gitignore rearrange content to fit the new standard layout 2017-07-01 01:08:19 +08:00
.gitreview Update .gitreview for stable/rocky 2018-07-26 12:37:52 +00:00
.mailmap Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
.testr.conf Move files out of the namespace package 2014-12-24 13:28:48 +02:00
.zuul.yaml import zuul job settings from project-config 2018-08-03 18:01:37 -04:00
CONTRIBUTING.rst Drop MySQL-python dependency from oslo.db 2017-10-17 07:17:06 +02:00
HACKING.rst Update URLs according to document migration 2017-07-11 22:28:01 +08:00
LICENSE Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
README.rst Add release notes to README.rst 2018-06-21 13:16:03 +08:00
babel.cfg Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
lower-constraints.txt Remove most server_default comparison logic 2018-06-15 13:31:38 +10:00
requirements.txt Remove most server_default comparison logic 2018-06-15 13:31:38 +10:00
setup.cfg Remove tox_install.sh and align constraints consumption 2018-03-08 09:46:24 -06:00
setup.py Updated from global requirements 2017-03-03 00:03:00 +00:00
test-requirements.txt uncap eventlet 2018-04-11 11:52:27 -04:00
tox.ini Update UPPER_CONSTRAINTS_FILE for stable/rocky 2018-07-26 12:37:54 +00:00

README.rst

Team and repository tags

image

oslo.db -- OpenStack Database Pattern Library

Latest Version

Downloads

The oslo db (database) handling library, provides database connectivity to different database backends and various other helper utils.