:func:`.create_engine` as well as :class:`.String` is removed.
:meth:`.ColumnOperators.notlike`,
:meth:`.ColumnOperators.notilike` to :class:`.ColumnOperators`.
+ .. change::
+ :tags: sql, removed
+
+ The long-deprecated and non-functional ``assert_unicode`` flag on
+ :func:`.create_engine` as well as :class:`.String` is removed.
\ No newline at end of file
:ref:`connections_toplevel`
- :param assert_unicode: Deprecated. This flag
- sets an engine-wide default value for
- the ``assert_unicode`` flag on the
- :class:`.String` type - see that
- type for further details.
-
:param case_sensitive=True: if False, result column names
will match in a case-insensitive fashion, that is,
``row['SomeColumn']``.
reflection_options = ()
- def __init__(self, convert_unicode=False, assert_unicode=False,
+ def __init__(self, convert_unicode=False,
encoding='utf-8', paramstyle=None, dbapi=None,
implicit_returning=None,
case_sensitive=True,
self.name)
self.convert_unicode = convert_unicode
- if assert_unicode:
- util.warn_deprecated(
- "assert_unicode is deprecated. "
- "SQLAlchemy emits a warning in all cases where it "
- "would otherwise like to encode a Python unicode object "
- "into a specific encoding but a plain bytestring is "
- "received. "
- "This does *not* apply to DBAPIs that coerce Unicode "
- "natively.")
-
self.encoding = encoding
self.positional = False
self._ischema = None
def __init__(self, length=None, collation=None,
convert_unicode=False,
- assert_unicode=None, unicode_error=None,
+ unicode_error=None,
_warn_on_bytestring=False
):
"""
cause SQLAlchemy's encode/decode services to be
used unconditionally.
- :param assert_unicode: Deprecated. A warning is emitted
- when a non-``unicode`` object is passed to the
- :class:`.Unicode` subtype of :class:`.String`,
- or the :class:`.UnicodeText` subtype of :class:`.Text`.
- See :class:`.Unicode` for information on how to
- control this warning.
-
:param unicode_error: Optional, a method to use to handle Unicode
conversion errors. Behaves like the ``errors`` keyword argument to
the standard library's ``string.decode()`` functions. This flag
raise exc.ArgumentError("convert_unicode must be 'force' "
"when unicode_error is set.")
- if assert_unicode:
- util.warn_deprecated('assert_unicode is deprecated. '
- 'SQLAlchemy emits a warning in all '
- 'cases where it would otherwise like '
- 'to encode a Python unicode object '
- 'into a specific encoding but a plain '
- 'bytestring is received. This does '
- '*not* apply to DBAPIs that coerce '
- 'Unicode natively.')
self.length = length
self.collation = collation
self.convert_unicode = convert_unicode
# Unicode
def genunicodevalue(rnum, fnum):
return (rnum % 4) and (u"value%d" % fnum) or None
-unicodetest = (Unicode(20, assert_unicode=False), genunicodevalue,
+unicodetest = (Unicode(20, ), genunicodevalue,
dict(num_records=100000))
# dict(engineurl='mysql:///test', freshdata=False))
for engineurl in ('postgresql://scott:tiger@localhost/test',
'sqlite://', 'mysql://scott:tiger@localhost/test'):
print "\n%s\n" % engineurl
- test_table = prepare(Unicode(20, assert_unicode=False),
+ test_table = prepare(Unicode(20,),
genunicodevalue,
num_fields=10, num_records=100000,
verbose=verbose, engineurl=engineurl)