commit af4b2263e4852de2bd4e66848a18be4d2282bacc
Author: Mike Bayer <email address hidden>
Date: Fri Feb 1 11:53:26 2019 -0500
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.
Reviewed: https:/ /review. openstack. org/634455 /git.openstack. org/cgit/ openstack/ oslo.db/ commit/ ?id=af4b2263e48 52de2bd4e66848a 18be4d2282bacc
Committed: https:/
Submitter: Zuul
Branch: master
commit af4b2263e4852de 2bd4e66848a18be 4d2282bacc
Author: Mike Bayer <email address hidden>
Date: Fri Feb 1 11:53:26 2019 -0500
Resolve SAWarning in Query.soft_delete()
We currently see a lot of warnings like this from
the soft_delete() method:
sqlalchem y.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 column( 'id'), column( 'updated_ at'), are not mapped to anything. The
to search for objects and update them based on the UPDATE criteria
passed, however the columns given, literal_
literal_
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.sqlalchem y.org/en/ latest/ changelog/ changelog_ 12.html# change- b1e620dece39006 ab44c47044e9a6f ee /docs.sqlalchem y.org/en/ latest/ changelog/ changelog_ 12.html# change- dff3a469788c81a 46440584406cb22 be
[2] https:/
Change-Id: I192e84ce757d12 d33085a209dd58d 8ea46fb90fb
Closes-Bug: #1814199