Skip to content

False Assumption on Redis's dcode_response #24

Closed
@AustinJiangH

Description

@AustinJiangH

This line assumes that the output for keys() are bytes. This assumption is only true when the Redis client is created with decode_responses=False. In the case of True, the return will be a str and it will have error decoding the byte.

matching_keys: List[bytes] = self._redis.keys(pattern=writes_key) # type: ignore[assignment]
parsed_keys = [
BaseRedisSaver._parse_redis_checkpoint_writes_key(key.decode())
for key in matching_keys
]

It is easy to reproduce as long as you create a Redis client with decode_response=True.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions