-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
If you execute jsonget on the Client and the key does not exist, it will catch the TypeError and instead return None, as expected.
If you execute jsonget on a pipeline and the key does not exist, it will throw the TypeError that results from json decoding the None value. Because of this, I cannot get any of the other results from the other commands from the pipeline.
Python 3.6.9
rejson 0.5.4
Traceback (most recent call last):
File "test.py", line 7, in <module>
result = pipeline.execute()
File "/home/user/.local/lib/python3.6/site-packages/redis/client.py", line 4019, in execute
return execute(conn, stack, raise_on_error)
File "/home/user/.local/lib/python3.6/site-packages/redis/client.py", line 3943, in _execute_transaction
r = self.response_callbacks[command_name](r, **options)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: expected string or bytes-like object
import rejson
rj = rejson.Client(host='localhost', port=6379, decode_responses=True)
pipeline = rj.pipeline()
pipeline.jsonget("gdrbhiserbgherigh")
result = pipeline.execute()
Metadata
Metadata
Assignees
Labels
No labels