]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Gracefully degrade for SQLite JSON receiving direct numeric value
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Nov 2019 15:50:44 +0000 (10:50 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Nov 2019 15:54:12 +0000 (10:54 -0500)
commitbb338b91752f4f758edd9b2549a228e891596ae0
treee92e30b621c41bf4ce706cb04c90f99cc6fa8cd9
parent06b0892da049a995ee4cd1e7cc3c1eb68f3dde64
Gracefully degrade for SQLite JSON receiving direct numeric value

Fixed issue to workaround SQLite's behavior of assigning "numeric" affinity
to JSON datatypes, first described at :ref:`change_3850`, which returns
scalar numeric JSON values as a number and not as a string that can be JSON
deserialized.  The SQLite-specific JSON deserializer now gracefully
degrades for this case as an exception and bypasses deserialization for
single numeric values, as from a JSON perspective they are already
deserialized.

Also adds a combinatoric fixture for JSON single values within
the dialect-general test suite.

Fixes: #5014
Change-Id: Id38221dce1271fec527ca198b23908547b25d8a0
doc/build/changelog/unreleased_13/5014.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/testing/suite/test_types.py