summaryrefslogtreecommitdiff
path: root/oslo_db
diff options
context:
space:
mode:
authorRoman Podoliaka <rpodolyaka@mirantis.com>2016-11-04 16:00:15 +0200
committerRoman Podoliaka <rpodolyaka@mirantis.com>2016-11-04 16:13:23 +0200
commitcee01482ec89710b166ac27ef43307518068a6a5 (patch)
treeb981313b52bc587d60a12955b433584eea35df62 /oslo_db
parent699933ca01884efe39cfed44946c3d570b5ebbfe (diff)
downloadoslo-db-cee01482ec89710b166ac27ef43307518068a6a5.tar.gz
utils: deprecate InsertFromSelect properly
This is provided out-of-box by SQLAlchemy versions >= 1.0.0. We've had this class deprecated in docs for some time now, now do it properly by the means of debtcollector and a release note. Closes-Bug: #1439092 Change-Id: I562c35c265014c6b19a81961f236a7a0ca438765
Diffstat (limited to 'oslo_db')
-rw-r--r--oslo_db/sqlalchemy/utils.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/oslo_db/sqlalchemy/utils.py b/oslo_db/sqlalchemy/utils.py
index 87c6f07..8ce7c2a 100644
--- a/oslo_db/sqlalchemy/utils.py
+++ b/oslo_db/sqlalchemy/utils.py
@@ -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