redis / redis-py

Redis Python client
MIT License
12.57k stars 2.51k forks source link

Discrepancy in `INFO` response parsing #3262

Closed raz-mon closed 3 months ago

raz-mon commented 3 months ago

Version: 5.0.0

Description: The code for parsing the INFO response is creating a discrepancy in the new RediSearch index field types field, e.g., search_fields_text. If there is more than one section to this field its corresponding value (e.g., TEXT=1, SORTABLE=1) is returned as a dictionary (as expected), while if there is only one value for it (e.g., TEXT=1) it is returned as a string!

This is bad since we later use this value assuming that it is a dictionary, and thus face failures in the case that it is not. The wanted behavior: We always get a dictionary back, whether we have only one section for this value or more.

Example: We have one section for the TEXT field, and two for the TAG field, and this is what we get: image

The source of the problem is in the parse_info() function, here.

Thanks!