From 5e100a70c51362b522c8d4a05c0149c7d77672fb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 16 Feb 2014 17:20:18 -0500 Subject: - The SQLite dialect will now skip unsupported arguments when reflecting types; such as if it encounters a string like ``INTEGER(5)``, the :class:`.INTEGER` type will be instantiated without the "5" being included, based on detecting a ``TypeError`` on the first attempt. --- lib/sqlalchemy/dialects/sqlite/base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/sqlite') diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index b285bc8ca..a1bd05d38 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -867,7 +867,14 @@ class SQLiteDialect(default.DefaultDialect): coltype = self._resolve_type_affinity(coltype) if args is not None: args = re.findall(r'(\d+)', args) - coltype = coltype(*[int(a) for a in args]) + try: + coltype = coltype(*[int(a) for a in args]) + except TypeError: + util.warn( + "Could not instantiate type %s with " + "reflected arguments %s; using no arguments." % + (coltype, args)) + coltype = coltype() if default is not None: default = util.text_type(default) -- cgit v1.2.1