Remove AutoString* in ndb.py

Remove AutoString* in ndb.py including
AutoStringTinyText,AutoStringText,AutoStringSize.

Change-Id: I707d69facb8f4542550243c1b5eff051264f3204
Closes-Bug:#1714913
This commit is contained in:
zhangyangyang 2017-09-04 19:22:46 +08:00
parent e9a9701d54
commit c81bb2ff56
2 changed files with 0 additions and 37 deletions

View File

@ -15,14 +15,10 @@
import re import re
import debtcollector.removals
from oslo_db.sqlalchemy.compat import utils as compat_utils from oslo_db.sqlalchemy.compat import utils as compat_utils
from oslo_db.sqlalchemy.types import String from oslo_db.sqlalchemy.types import String
from sqlalchemy import event, schema from sqlalchemy import event, schema
from sqlalchemy.dialects.mysql import TEXT
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.ext.compiler import compiles from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import String as _String from sqlalchemy.types import String as _String
from sqlalchemy.types import to_instance from sqlalchemy.types import to_instance
@ -112,18 +108,3 @@ def _compile_ndb_string(element, compiler, **kw):
return compiler.process(effective_type, **kw) return compiler.process(effective_type, **kw)
else: else:
return compiler.visit_string(element, **kw) return compiler.visit_string(element, **kw)
@debtcollector.removals.remove
def AutoStringTinyText(length, **kw):
return String(length, mysql_ndb_type=TINYTEXT, *kw)
@debtcollector.removals.remove
def AutoStringText(length, **kw):
return String(length, mysql_ndb_type=TEXT, **kw)
@debtcollector.removals.remove
def AutoStringSize(length, ndb_size, **kw):
return String(length, mysql_ndb_length=ndb_size, **kw)

View File

@ -111,24 +111,6 @@ class NDBEventTestCase(NDBMockTestBase):
class NDBDatatypesTestCase(NDBMockTestBase): class NDBDatatypesTestCase(NDBMockTestBase):
def test_ndb_deprecated_autostringtinytext(self):
test_engine = self.test_engine
self.assertEqual("TINYTEXT",
str(ndb.AutoStringTinyText(255).compile(
dialect=test_engine.dialect)))
def test_ndb_deprecated_autostringtext(self):
test_engine = self.test_engine
self.assertEqual("TEXT",
str(ndb.AutoStringText(4096).compile(
dialect=test_engine.dialect)))
def test_ndb_deprecated_autostringsize(self):
test_engine = self.test_engine
self.assertEqual('VARCHAR(64)',
str(ndb.AutoStringSize(255, 64).compile(
dialect=test_engine.dialect)))
def test_ndb_string_to_tinytext(self): def test_ndb_string_to_tinytext(self):
test_engine = self.test_engine test_engine = self.test_engine
self.assertEqual("TINYTEXT", self.assertEqual("TINYTEXT",