diff options
author | Chayim I. Kirshen <c@kirshen.com> | 2021-11-01 13:50:00 +0200 |
---|---|---|
committer | Chayim I. Kirshen <c@kirshen.com> | 2021-11-01 13:50:00 +0200 |
commit | 3741313e0ea90edf56239330c4aa8f02e351db44 (patch) | |
tree | b44b08aaea1a95c03a14aaff28de3c1f93380b07 | |
parent | ade01832cdc9fb711023a60849181981f2b4ee81 (diff) | |
download | redis-py-3741313e0ea90edf56239330c4aa8f02e351db44.tar.gz |
fixing more json tests
-rw-r--r-- | redis/commands/json/__init__.py | 16 | ||||
-rw-r--r-- | redis/commands/json/commands.py | 6 | ||||
-rw-r--r-- | redis/commands/json/decoders.py | 12 | ||||
-rw-r--r-- | tests/test_json.py | 207 | ||||
-rw-r--r-- | tests/testdata/jsontestdata.py | 154 |
5 files changed, 265 insertions, 130 deletions
diff --git a/redis/commands/json/__init__.py b/redis/commands/json/__init__.py index 9783705..ead0e77 100644 --- a/redis/commands/json/__init__.py +++ b/redis/commands/json/__init__.py @@ -1,6 +1,10 @@ from json import JSONDecoder, JSONEncoder from .helpers import bulk_of_jsons +from .decoders import ( + decode_list_or_int, + decode_toggle +) from ..helpers import nativestr, delist from .commands import JSONCommands @@ -42,9 +46,9 @@ class JSON(JSONCommands): "JSON.SET": lambda r: r and nativestr(r) == "OK", "JSON.NUMINCRBY": self._decode, "JSON.NUMMULTBY": self._decode, - "JSON.TOGGLE": lambda b: b == b"true", + "JSON.TOGGLE": decode_toggle, "JSON.STRAPPEND": int, - "JSON.STRLEN": int, + "JSON.STRLEN": decode_list_or_int, "JSON.ARRAPPEND": int, "JSON.ARRINDEX": int, "JSON.ARRINSERT": int, @@ -54,7 +58,6 @@ class JSON(JSONCommands): "JSON.OBJLEN": int, "JSON.OBJKEYS": delist, # "JSON.RESP": delist, - "JSON.DEBUG": int, } self.client = client @@ -73,9 +76,14 @@ class JSON(JSONCommands): return obj try: - return self.__decoder__.decode(obj) + x = self.__decoder__.decode(obj) + if x is None: + raise TypeError except TypeError: return self.__decoder__.decode(obj.decode()) + finally: + import json + return json.loads(obj.decode()) def _encode(self, obj): """Get the encoder.""" diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py index 2f8039f..cccb55e 100644 --- a/redis/commands/json/commands.py +++ b/redis/commands/json/commands.py @@ -83,7 +83,7 @@ class JSONCommands: ``path`` at key ``name`` by the provided ``number``. """ return self.execute_command( - "JSON.NUMINCRBY", name, str_path(path), self._encode(number) + "JSON.NUMINCRBY", name, str_path(path), str(number) ) def nummultby(self, name, path, number): @@ -91,7 +91,7 @@ class JSONCommands: ``path`` at key ``name`` with the provided ``number``. """ return self.execute_command( - "JSON.NUMMULTBY", name, str_path(path), self._encode(number) + "JSON.NUMMULTBY", name, str_path(path), str(number) ) def clear(self, name, path=Path.rootPath()): @@ -189,7 +189,7 @@ class JSONCommands: "JSON.STRAPPEND", name, str_path(path), self._encode(string) ) - def debug(self, name, path=Path.rootPath()): + def debug(self, name, path=Path.rootPath()): """Return the memory usage in bytes of a value under ``path`` from key ``name``. """ diff --git a/redis/commands/json/decoders.py b/redis/commands/json/decoders.py new file mode 100644 index 0000000..d08b620 --- /dev/null +++ b/redis/commands/json/decoders.py @@ -0,0 +1,12 @@ +from ..helpers import delist + + +def decode_toggle(b): + if isinstance(b, list): + return b + return b == b"true" + +def decode_list_or_int(b): + if isinstance(b, list): + return b + return int(b)
\ No newline at end of file diff --git a/tests/test_json.py b/tests/test_json.py index 3c89ae3..48bbf8e 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -312,8 +312,8 @@ def test_json_forget_with_dollar(client): @pytest.mark.redismod def test_set_and_get_with_dollar(client): # Test set and get on large nested key - assert client.json().set("doc1", "$", nested_large_key, "XX") is None - assert client.json().set("doc1", "$", nested_large_key, "NX") + client.json().set("doc1", "$", nested_large_key, "XX") + client.json().set("doc1", "$", nested_large_key, "NX") assert client.json().get('doc1', '$') == [nested_large_key] assert client.json().set("doc1", "$", nested_large_key, "NX") is None @@ -385,59 +385,42 @@ def test_json_mget_dollar(client): assert res == [None, None] @pytest.mark.redismod -def test_numby_commands_dollar(env): - - r = env +def test_numby_commands_dollar(client): # Test NUMINCRBY client.json().set('doc1', '$', {"a":"b","b":[{"a":2}, {"a":5.0}, {"a":"c"}]}) # Test multi - assert client.json().numincrby('doc1', '$..a', '2') == [None, 4, 7.0, None] + assert client.json().numincrby('doc1', '$..a', 2) == [None, 4, 7.0, None] - assert client.json().numincrby('doc1', '$..a', '2.5') == [None, 6.5, 9.5, None] + assert client.json().numincrby('doc1', '$..a', 2.5) == [None, 6.5, 9.5, None] # Test single - assert client.json().numincrby('doc1', '$.b[1].a', '2') == [11.5] + assert client.json().numincrby('doc1', '$.b[1].a', 2) == [11.5] - assert client.json().numincrby('doc1', '$.b[2].a', '2') == [None] - assert client.json().numincrby('doc1', '$.b[1].a', '3.5') == [15.0] + assert client.json().numincrby('doc1', '$.b[2].a', 2) == [None] + assert client.json().numincrby('doc1', '$.b[1].a', 3.5) == [15.0] # Test NUMMULTBY client.json().set('doc1', '$', {"a":"b","b":[{"a":2}, {"a":5.0}, {"a":"c"}]}) - assert client.json().nummultby('doc1', '$..a', '2') == [None, 4, 10, None] - assert client.json().nummultby('doc1', '$..a', '2.5') == [None,10.0,25.0,None] + assert client.json().nummultby('doc1', '$..a', 2) == [None, 4, 10, None] + assert client.json().nummultby('doc1', '$..a', 2.5) == [None,10.0,25.0,None] # Test single - assert client.json().nummultby('doc1', '$.b[1].a', '2') == [50.0] - assert client.json().nummultby('doc1', '$.b[2].a', '2') == [None] - assert client.json().nummultby('doc1', '$.b[1].a', '3') == [150.0] + assert client.json().nummultby('doc1', '$.b[1].a', 2) == [50.0] + assert client.json().nummultby('doc1', '$.b[2].a', 2) == [None] + assert client.json().nummultby('doc1', '$.b[1].a', 3) == [150.0] - # Test NUMPOWBY - client.json().set('doc1', '$', {"a":"b","b":[{"a":2}, {"a":5.0}, {"a":"c"}]}) - # Test multi - assert client.json().numpowby('doc1', '$..a', '2') == [None, 4, 25, None] - # Avoid json.loads to verify the underlying type (integer/float) - assert client.json().numpowby('doc1', '$..a', '2') == [None,16,625.0,None] - - # Test single - assert client.json().numpowby('JSON.NUMPOWBY', 'doc1', '$.b[1].a', '2') == [390625.0] - assert client.json().numpowby('JSON.NUMPOWBY', 'doc1', '$.b[2].a', '2') == [None] - assert client.json().numpowby('JSON.NUMPOWBY', 'doc1', '$.b[1].a', '3') == [5.960464477539062e16] - - # Test missing key - with pytest.raises(exceptions.DataError): - client.json().numincrby('non_existing_doc', '$..a', '2') - client.json().nummultby('non_existing_doc', '$..a', '2') - - # TODO fixme - r.expect('JSON.NUMPOWBY', 'non_existing_doc', '$..a', '2') + # test missing keys + with pytest.raises(exceptions.ResponseError): + client.json().numincrby('non_existing_doc', '$..a', 2) + client.json().nummultby('non_existing_doc', '$..a', 2) # Test legacy NUMINCRBY client.json().set('doc1', '$', {"a":"b","b":[{"a":2}, {"a":5.0}, {"a":"c"}]}) - client.json().numincrby('doc1', '.b[0].a', '3') == 5 + client.json().numincrby('doc1', '.b[0].a', 3) == 5 # Test legacy NUMMULTBY client.json().set('doc1', '$', {"a":"b","b":[{"a":2}, {"a":5.0}, {"a":"c"}]}) - client.json().nummultby('doc1', '.b[0].a', '3') == 6 + client.json().nummultby('doc1', '.b[0].a', 3) == 6 @pytest.mark.redismod def test_strappend_dollar(client): @@ -470,7 +453,7 @@ def test_strlen_dollar(client): # Test multi client.json().set('doc1', '$', {"a":"foo", "nested1": {"a": "hello"}, "nested2": {"a": 31}}) - res1 = client.json().strlen('doc1', '$..a') [3, 5, None] + assert client.json().strlen('doc1', '$..a') == [3, 5, None] res2 = client.json().strappend('doc1', '$..a', '"bar"') == [6, 8, None] res1 = client.json().strlen('doc1', '$..a') @@ -481,7 +464,7 @@ def test_strlen_dollar(client): client.json().strlen('doc1', '$.nested2.a') == [None] # Test missing key - with pytest.raises(exceptions.DataError): + with pytest.raises(exceptions.ResponseError): client.json().strlen('non_existing_doc', '$..a') @pytest.mark.redismod @@ -575,7 +558,7 @@ def test_arrlen_dollar(client): assert client.json().arrappend('doc1', '..a', '"non"', '"abba"', '"stanza"') == 6 # Test single - assert client.json().arrlen('doc1', '.nested1.a') = 6 + assert client.json().arrlen('doc1', '.nested1.a') == 6 # Test missing key assert client.json().arrlen('non_existing_doc', '..a') is None @@ -584,7 +567,7 @@ def test_arrlen_dollar(client): def test_arrpop_dollar(client): client.json().set('doc1', '$', {"a":["foo"], "nested1": {"a": ["hello", None, "world"]}, "nested2": {"a": 31}}) # Test multi - assert client.json().arrpop('doc1', '$..a', '1') == ['"foo"', 'null', None] + assert client.json().arrpop('doc1', '$..a', '1') == ['"foo"', 'None', None] assert client.json().get('doc1', '$') == \ [{"a": [], "nested1": {"a": ["hello", "world"]}, "nested2": {"a": 31}}] @@ -731,7 +714,7 @@ def test_type_dollar(client): jdata, jtypes = load_types_data('a') client.json().set('doc1', '$', jdata) # Test multi - assert client.json().type('JSON.TYPE', 'doc1', '$..a') == jtypes + assert client.json().type('doc1', '$..a') == jtypes # Test single assert client.json().type('doc1', '$.nested2.a') == [jtypes[1]] @@ -793,18 +776,150 @@ def test_debug_dollar(client): client.json().set('doc1', '$', jdata) # Test multi - assert client.json().debug('MEMORY', 'doc1', '$..a') == \ + assert client.json().debug('doc1', '$..a') == \ [72, 24, 24, 16, 16, 1, 0] # Test single - assert client.json().debug('MEMORY', 'doc1', '$.nested2.a') == [24] + assert client.json().debug('doc1', '$.nested2.a') == [24] # Test legacy - assert client.json().debug('MEMORY', 'doc1', '..a') == 72 + assert client.json().debug('doc1', '..a') == 72 # Test missing path (defaults to root) - assert client.json().debug('MEMORY', 'doc1') == 72 + assert client.json().debug('doc1') == 72 # Test missing key + assert client.json().debug('non_existing_doc', '$..a') == [] + +def test_resp_dollar(client): + + data = { + 'L1': { + 'a': { + 'A1_B1': 10, + 'A1_B2': False, + 'A1_B3': { + 'A1_B3_C1': None, + 'A1_B3_C2': [ 'A1_B3_C2_D1_1', 'A1_B3_C2_D1_2', -19.5, 'A1_B3_C2_D1_4', 'A1_B3_C2_D1_5', { + 'A1_B3_C2_D1_6_E1': True + } + ], + 'A1_B3_C3': [1] + }, + 'A1_B4': { + 'A1_B4_C1': "foo", + } + }, + }, + 'L2': { + 'a': { + 'A2_B1': 20, + 'A2_B2': False, + 'A2_B3': { + 'A2_B3_C1': None, + 'A2_B3_C2': [ 'A2_B3_C2_D1_1', 'A2_B3_C2_D1_2', -37.5, 'A2_B3_C2_D1_4', 'A2_B3_C2_D1_5', { + 'A2_B3_C2_D1_6_E1': False + } + ], + 'A2_B3_C3': [2] + }, + 'A2_B4': { + 'A2_B4_C1': "bar", + } + }, + }, + } + client.json().set('doc1', '$', data) + # Test multi + res = client.json().resp('doc1', '$..a') + assert res == [['{', 'A1_B1', 10, 'A1_B2', 'false', 'A1_B3', ['{', 'A1_B3_C1', None, 'A1_B3_C2', ['[', 'A1_B3_C2_D1_1', 'A1_B3_C2_D1_2', '-19.5', 'A1_B3_C2_D1_4', 'A1_B3_C2_D1_5', ['{', 'A1_B3_C2_D1_6_E1', 'true']], 'A1_B3_C3', ['[', 1]], 'A1_B4', ['{', 'A1_B4_C1', 'foo']], ['{', 'A2_B1', 20, 'A2_B2', 'false', 'A2_B3', ['{', 'A2_B3_C1', None, 'A2_B3_C2', ['[', 'A2_B3_C2_D1_1', 'A2_B3_C2_D1_2', '-37.5', 'A2_B3_C2_D1_4', 'A2_B3_C2_D1_5', ['{', 'A2_B3_C2_D1_6_E1', 'false']], 'A2_B3_C3', ['[', 2]], 'A2_B4', ['{', 'A2_B4_C1', 'bar']]] + + # Test single + resSingle = client.json().resp('doc1', '$.L1.a') + assert resSingle == [['{', 'A1_B1', 10, 'A1_B2', 'false', 'A1_B3', ['{', 'A1_B3_C1', None, 'A1_B3_C2', ['[', 'A1_B3_C2_D1_1', 'A1_B3_C2_D1_2', '-19.5', 'A1_B3_C2_D1_4', 'A1_B3_C2_D1_5', ['{', 'A1_B3_C2_D1_6_E1', 'true']], 'A1_B3_C3', ['[', 1]], 'A1_B4', ['{', 'A1_B4_C1', 'foo']]] + + # Test missing path + with pytest.raises(exceptions.DataError): + client.json().resp('doc1', '$.nowhere') + + # Test missing key + assert client.json().resp('non_existing_doc', '$..a') is None + + # Test legacy + assert client.json().resp('doc1', '.L1.a') == resSingle + +def test_arrindex_dollar(client): + + client.json().set( + 'store', + '$', + {"store":{"book":[{"category":"reference","author":"Nigel Rees","title":"Sayings of the Century","price":8.95,"size":[10,20,30,40]},{"category":"fiction","author":"Evelyn Waugh","title":"Sword of Honour","price":12.99,"size":[50,60,70,80]},{"category":"fiction","author":"Herman Melville","title":"Moby Dick","isbn":"0-553-21311-3","price":8.99,"size":[5,10,20,30]},{"category":"fiction","author":"J. R. R. Tolkien","title":"The Lord of the Rings","isbn":"0-395-19395-8","price":22.99,"size":[5,6,7,8]}],"bicycle":{"color":"red","price":19.95}}}) + + assert client.json().get( + 'store', + '$.store.book[?(@.price<10)].size') == [[10,20,30,40],[5,10,20,30]] + assert client.json().arrindex( + 'store', + '$.store.book[?(@.price<10)].size', + '20') == [1, 2] + + # Test index of int scalar in multi values + client.json().set('test_num', + '.', + [{"arr":[0,1,3.0,3,2,1,0,3]},{"nested1_found":{"arr":[5,4,3,2,1,0,1,2,3.0,2,4,5]}},{"nested2_not_found":{"arr":[2,4,6]}},{"nested3_scalar":{"arr":"3"}},[{"nested41_not_arr":{"arr_renamed":[1,2,3]}},{"nested42_empty_arr":{"arr":[]}}]]) + + assert client.json().get('test_num', '$..arr') == \ + [[0,1,3.0,3,2,1,0,3],[5,4,3,2,1,0,1,2,3.0,2,4,5],[2,4,6],"3",[]] + + assert client.json().arrindex('test_num', '$..arr', 3) == [3, 2, -1, None, -1] + + # Test index of double scalar in multi values + assert client.json().arrindex('test_num', '$..arr', 3.0) == [2, 8, -1, None, -1] + + # Test index of string scalar in multi values + client.json().set('test_string', + '.', + [{"arr":["bazzz","bar",2,"baz",2,"ba","baz",3]},{"nested1_found":{"arr":[None,"baz2","buzz",2,1,0,1,"2","baz",2,4,5]}},{"nested2_not_found":{"arr":["baz2",4,6]}},{"nested3_scalar":{"arr":"3"}},[{"nested41_arr":{"arr_renamed":[1,"baz",3]}},{"nested42_empty_arr":{"arr":[]}}]]) + assert client.json().get('test_string', '$..arr') == \ + [["bazzz","bar",2,"baz",2,"ba","baz",3],[None,"baz2","buzz",2,1,0,1,"2","baz",2,4,5],["baz2",4,6],"3",[]] + + assert client.json().arrindex('test_string', '$..arr', '"baz"') == [3, 8, -1, None, -1] + + assert client.json().arrindex('test_string', '$..arr', '"baz"', 2) == [3, 8, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '"baz"', 4) == [6, 8, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '"baz"', -5) == [3, 8, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '"baz"', 4, 7) == [6, -1, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '"baz"', 4, -1) == [6, 8, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '"baz"', 4, 0) == [6, 8, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '5', 7, -1) == [-1, -1, -1, None, -1] + assert client.json().arrindex('test_string', '$..arr', '5', 7, 0) == [-1, 11, -1, None, -1] + + # Test index of None scalar in multi values + client.json().set('test_None', + '.', + [{"arr":["bazzz","None",2,None,2,"ba","baz",3]},{"nested1_found":{"arr":["zaz","baz2","buzz",2,1,0,1,"2",None,2,4,5]}},{"nested2_not_found":{"arr":["None",4,6]}},{"nested3_scalar":{"arr":None}},[{"nested41_arr":{"arr_renamed":[1,None,3]}},{"nested42_empty_arr":{"arr":[]}}]]) + assert client.json.get('test_None', '$..arr') == \ + [["bazzz","None",2,None,2,"ba","baz",3],["zaz","baz2","buzz",2,1,0,1,"2",None,2,4,5],["None",4,6],None,[]] + + assert client.json().arrindex('test_None', '$..arr', 'None') == [3, 8, -1, None, -1] + + # Fail with none-scalar value + with pytest.raises(exceptions.DataError): + client.json().arrindex('test_None', '$..nested42_empty_arr.arr', {"arr":[]}) + + # Do not fail with none-scalar value in legacy mode + assert client.json().arrindex('test_None', '.[4][1].nested42_empty_arr.arr', '{"arr":[]}') == -1 + + # Test legacy (path begins with dot) + # Test index of int scalar in single value + assert client.json().arrindex('test_num', '.[0].arr', 3) == 3 + assert client.json().arrindex('test_num', '.[0].arr', 9) == -1 + with pytest.raises(exceptions.DataError): - client.json().debug('non_existing_doc', '$..a')
\ No newline at end of file + client.json().arrindex('test_num', '.[0].arr_not', 3) + # Test index of string scalar in single value + assert client.json().arrindex('test_string', '.[0].arr', '"baz"') == 3 + assert client.json().arrindex('test_string', '.[0].arr', '"faz"') == -1 + # Test index of None scalar in single value + assert client.json().arrindex('test_None', '.[0].arr', 'None') == 3 + assert client.json().arrindex('test_None', '..nested2_not_found.arr', 'None') == -1 diff --git a/tests/testdata/jsontestdata.py b/tests/testdata/jsontestdata.py index 744fe21..32ca6af 100644 --- a/tests/testdata/jsontestdata.py +++ b/tests/testdata/jsontestdata.py @@ -29,7 +29,7 @@ nested_large_key = r""" "mp": { "ory": "rj", "qnl": "tyfrju", - "hf": null + "hf": None }, "uooc": 7418, "xela": 20, @@ -37,11 +37,11 @@ nested_large_key = r""" "ia": 547, "szec": 68.73 }, - null + None ], 3622, "iwk", - null + None ], "fepi": 19.954, "ivu": { @@ -72,9 +72,9 @@ nested_large_key = r""" true, [] ], - null, + None, "ymbc", - null + None ], "aj", 97.425, @@ -98,13 +98,13 @@ nested_large_key = r""" 534.389, 7235, [ - null, + None, false, - null + None ] ] }, - null, + None, { "lbrx": { "vm": "ubdrbb" @@ -115,13 +115,13 @@ nested_large_key = r""" 70.558, [ { - "mmo": null, - "dryu": null + "mmo": None, + "dryu": None } ] ], true, - null, + None, false, { "jqun": 98, @@ -137,7 +137,7 @@ nested_large_key = r""" "jt", true, { - "bn": null, + "bn": None, "ygn": "cve", "zhh": true, "aak": 9165, @@ -146,14 +146,14 @@ nested_large_key = r""" }, { "eio": 9933.6, - "agl": null, + "agl": None, "pf": false, "kv": 5099.631, - "no": null, + "no": None, "shly": 58 }, [ - null, + None, [ "uiundu", 726.652, @@ -161,14 +161,14 @@ nested_large_key = r""" 94.92, 259.62, { - "ntqu": null, - "frv": null, + "ntqu": None, + "frv": None, "rvop": "upefj", "jvdp": { "nhx": [], "bxnu": {}, - "gs": null, - "mqho": null, + "gs": None, + "mqho": None, "xp": 65, "ujj": {} }, @@ -203,19 +203,19 @@ nested_large_key = r""" "mc": [], "wunb": {}, "qcze": 2271.15, - "mcqx": null + "mcqx": None }, "qob" ], "wo": "zy" }, { - "dok": null, - "ygk": null, + "dok": None, + "ygk": None, "afdw": [ 7848, "ah", - null + None ], "foobar": 3.141592, "wnuo": { @@ -226,7 +226,7 @@ nested_large_key = r""" "omne": 3061.73, "bnwm": "wuuyy", "tuv": 7053, - "lepv": null, + "lepv": None, "xap": 94.26 }, "nuv": false, @@ -235,13 +235,13 @@ nested_large_key = r""" "dk": 2305, "wibo": 7512.9, "ytbc": 153, - "pokp": null, - "whzd": null, + "pokp": None, + "whzd": None, "judg": [], - "zh": null + "zh": None }, "bcnu": "ji", - "yhqu": null, + "yhqu": None, "gwc": true, "smp": { "fxpl": 75, @@ -253,7 +253,7 @@ nested_large_key = r""" "fxhy": [], "af": 94.46, "wg": {}, - "fb": null + "fb": None } }, "zvym": 2921, @@ -265,7 +265,7 @@ nested_large_key = r""" }, [ "uxlu", - null, + None, "utl", 64, [ @@ -273,7 +273,7 @@ nested_large_key = r""" ], [ false, - null, + None, [ "cfcrl", [], @@ -281,7 +281,7 @@ nested_large_key = r""" 562, 1654.9, {}, - null, + None, "sqzud", 934.6 ], @@ -289,7 +289,7 @@ nested_large_key = r""" "hk": true, "ed": "lodube", "ye": "ziwddj", - "ps": null, + "ps": None, "ir": {}, "heh": false }, @@ -299,18 +299,18 @@ nested_large_key = r""" [ 99, 6409, - null, + None, 4886, "esdtkt", {}, - null + None ], [ false, "bkzqw" ] ], - null, + None, 6357 ], { @@ -318,7 +318,7 @@ nested_large_key = r""" "vqm": { "drmv": 68.12, "tmf": 140.495, - "le": null, + "le": None, "sanf": [ true, [], @@ -334,7 +334,7 @@ nested_large_key = r""" "yrkh": 662.426, "vxj": true, "sn": 314.382, - "eorg": null + "eorg": None }, "bavq": [ 21.18, @@ -347,7 +347,7 @@ nested_large_key = r""" [ {}, "pjtr", - null, + None, "apyemk", [], [], @@ -355,7 +355,7 @@ nested_large_key = r""" {} ], { - "ho": null, + "ho": None, "ir": 124, "oevp": 159, "xdrv": 6705, @@ -363,17 +363,17 @@ nested_large_key = r""" "sx": false }, true, - null, + None, true ], "zw": "qjqaap", "hr": { "xz": 32, "mj": 8235.32, - "yrtv": null, + "yrtv": None, "jcz": "vnemxe", "ywai": [ - null, + None, 564, false, "vbr", @@ -391,15 +391,15 @@ nested_large_key = r""" ] ] ], - null, - null, + None, + None, { "xyzl": "nvfff" }, true, 13 ], - "npd": null, + "npd": None, "ha": [ [ "du", @@ -416,7 +416,7 @@ nested_large_key = r""" "dxpn": {}, "hmpx": 49, "zb": "gbpt", - "vdqc": null, + "vdqc": None, "ysjg": false, "gug": 7990.66 }, @@ -426,7 +426,7 @@ nested_large_key = r""" ], "dfywcu", 9686, - null + None ] ], "gpi": { @@ -452,7 +452,7 @@ nested_large_key = r""" "zj": "ivctu" }, "jl": 369.27, - "mxkx": null, + "mxkx": None, "sh": [ true, 373, @@ -460,22 +460,22 @@ nested_large_key = r""" "sdis", 6217, { - "ernm": null, + "ernm": None, "srbo": 90.798, "py": 677, - "jgrq": null, - "zujl": null, + "jgrq": None, + "zujl": None, "odsm": { - "pfrd": null, + "pfrd": None, "kwz": "kfvjzb", "ptkp": false, - "pu": null, - "xty": null, + "pu": None, + "xty": None, "ntx": [], "nq": 48.19, "lpyx": [] }, - "ff": null, + "ff": None, "rvi": [ "ych", {}, @@ -503,8 +503,8 @@ nested_large_key = r""" 2690.54, [ 93, - null, - null, + None, + None, "rlz", true, "ky", @@ -512,13 +512,13 @@ nested_large_key = r""" ] ], "vet": false, - "olle": null + "olle": None }, "jzm", true ], - null, - null, + None, + None, 19.17, 7145, "ipsmk" @@ -537,14 +537,14 @@ nested_large_key = r""" }, "xa": "trdw", "gn": 9875.687, - "dl": null, - "vuql": null + "dl": None, + "vuql": None }, { - "qpjo": null, + "qpjo": None, "das": { "or": { - "xfy": null, + "xfy": None, "xwvs": 4181.86, "yj": 206.325, "bsr": [ @@ -553,7 +553,7 @@ nested_large_key = r""" "wndm": { "ve": 56, "jyqa": true, - "ca": null + "ca": None }, "rpd": 9906, "ea": "dvzcyt" @@ -562,8 +562,8 @@ nested_large_key = r""" "rpx": "zpr", "srzg": { "beo": 325.6, - "sq": null, - "yf": null, + "sq": None, + "yf": None, "nu": [ 377, "qda", @@ -572,21 +572,21 @@ nested_large_key = r""" "sfz": "zjk" }, "kh": "xnpj", - "rk": null, + "rk": None, "hzhn": [ - null + None ], "uio": 6249.12, "nxrv": 1931.635, - "pd": null + "pd": None }, "pxlc": true, "mjer": false, "hdev": "msr", - "er": null + "er": None }, "ug", - null, + None, "yrfoix", 503.89, 563 @@ -596,22 +596,22 @@ nested_large_key = r""" "tm": [ 134.761, "jcoels", - null + None ], "iig": 945.57, "ad": "be" }, "ltpdm", - null, + None, 14.53 ], "xi": "gxzzs", "zfpw": 1564.87, - "ow": null, + "ow": None, "tm": [ 46, 876.85 ], - "xejv": null + "xejv": None } """
\ No newline at end of file |