[Sqlalchemy-tickets] Issue #4027: JSON Type throws error when using Dialect that does not support i
Brought to you by:
zzzeek
From: Adrian P. <iss...@bi...> - 2017-07-14 06:08:34
|
New issue 4027: JSON Type throws error when using Dialect that does not support it https://bitbucket.org/zzzeek/sqlalchemy/issues/4027/json-type-throws-error-when-using-dialect Adrian Partl: I want to use the JSON Column Type with the sqlite. This throws the following error, suggesting that this should work (i.e. JSON being serialised into string). However the code is broken at that point, since `_json_serializer` is not part of the dialect. This should be a `hasattr` test... ``` ... File "/Users/adrian/.virtualenvs/venv/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 493, in <genexpr> (key, value) for key, value in File "/Users/adrian/.virtualenvs/venv/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 496, in <genexpr> for bindparam in self.bind_names) File "/Users/adrian/.virtualenvs/venv/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py", line 459, in _cached_bind_processor d['bind'] = bp = d['impl'].bind_processor(dialect) File "/Users/adrian/.virtualenvs/venv/lib/python2.7/site-packages/sqlalchemy/sql/sqltypes.py", line 2050, in bind_processor json_serializer = dialect._json_serializer or json.dumps StatementError: (exceptions.AttributeError) 'SQLiteDialect_pysqlite' object has no attribute '_json_serializer' [SQL: u'INSERT INTO metadata... ``` |