Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in INFO response parsing #3262

Closed
raz-mon opened this issue Jun 4, 2024 · 0 comments · Fixed by #3265
Closed

Discrepancy in INFO response parsing #3262

raz-mon opened this issue Jun 4, 2024 · 0 comments · Fixed by #3265
Assignees

Comments

@raz-mon
Copy link
Contributor

raz-mon commented Jun 4, 2024

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!

@gerzse gerzse self-assigned this Jun 5, 2024
gerzse added a commit to gerzse/redis-py that referenced this issue Jun 5, 2024
If the INFO response contains a single `a=b` value for any of the keys,
that must also be parsed into a dictionary.

Fixes redis#3262
gerzse added a commit that referenced this issue Jun 5, 2024
If the INFO response contains a single `a=b` value for any of the keys,
that must also be parsed into a dictionary.

Fixes #3262

Co-authored-by: Gabriel Erzse <gabriel.erzse@redis.com>
gerzse added a commit to gerzse/redis-py that referenced this issue Jun 5, 2024
If the INFO response contains a single `a=b` value for any of the keys,
that must also be parsed into a dictionary.

Fixes redis#3262
gerzse added a commit that referenced this issue Jun 5, 2024
If the INFO response contains a single `a=b` value for any of the keys,
that must also be parsed into a dictionary.

Fixes #3262

Co-authored-by: Gabriel Erzse <gabriel.erzse@redis.com>
agnesnatasya pushed a commit to agnesnatasya/redis-py that referenced this issue Jul 20, 2024
If the INFO response contains a single `a=b` value for any of the keys,
that must also be parsed into a dictionary.

Fixes redis#3262

Co-authored-by: Gabriel Erzse <gabriel.erzse@redis.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants