Merge "utils: deprecate InsertFromSelect properly"

This commit is contained in:
Jenkins 2016-11-10 19:03:52 +00:00 committed by Gerrit Code Review
commit 4ecb9bd19c
2 changed files with 12 additions and 4 deletions

View File

@ -22,6 +22,7 @@ import itertools
import logging
import re
import debtcollector
from oslo_utils import timeutils
import six
import sqlalchemy
@ -415,13 +416,14 @@ def get_table(engine, name):
return Table(name, metadata, autoload=True)
@debtcollector.removals.removed_class(
'InsertFromSelect',
replacement='sqlalchemy.sql.expression.Insert.from_select',
message='this functionality is provided out-of-box by SQLAlchemy >= 1.0.0'
)
class InsertFromSelect(object):
"""Form the base for `INSERT INTO table (SELECT ... )` statement.
DEPRECATED: this class is deprecated and will be removed from oslo_db
in a few releases. Use default SQLAlchemy insert from select implementation
instead
:param table: table to insert records
:param select: select query
:param cols: list of columns to specify in insert clause

View File

@ -0,0 +1,6 @@
---
deprecations:
- class ``InsertFromSelect`` from module ``oslo_db.sqlalchemy.utils`` is
deprecated in favor of ``sqlalchemy.sql.expression.Insert.from_select()``
method of Insert expression, that is available in SQLAlchemy versions
1.0.0 and newer