redis / redis-om-python

Object mapping, and more, for Redis and Python
MIT License
1.11k stars 111 forks source link

UUID not supported in JSONModel #545

Closed bearrito closed 6 months ago

bearrito commented 1 year ago

I have a very simple model

This works

class RedisJob(redis_om.HashModel):
    task_id: UUID

This does not work

class RedisJob(redis_om.JsonModel):
    task_id: UUID

The latter returns

cloud_ros_runtime/venv/lib/python3.8/site-packages/redis/client.py", line 560, in parse_command
    cmd_name = str_if_bytes(command[0])
TypeError: 'NoneType' object is not subscriptable

Here are my associated redis packages

hiredis==2.2.3
redis==4.6.0
redis-om==0.2.1
types-redis==4.6.0.3
slorello89 commented 6 months ago

From what I'm looking at in these issues, I think it's more likely that you're having an issue with the redis version you are using rather than the uuid, regardless I've added a test to #603 just to validate that it does work.

bearrito commented 6 months ago

Could be. I'm not working on this any longer. I'll close this.