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

Uppercase commands in CommandsParser.get_keys #2236

Merged
merged 1 commit into from
Jun 19, 2022
Merged

Conversation

falk-h
Copy link
Contributor

@falk-h falk-h commented Jun 16, 2022

Pull Request check-list

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Was the change added to CHANGES file?

I haven't been able to get tox to pass locally. I'm unsure what the problem is, but it seems like it's related to uvloop. I'm sure it's just a problem with my dev environment as everything passes in CI.

Description of change

I ran into issues when migrating from the blocking RedisCluster to asyncio.RedisCluster where asyncio.CommandsParser.get_keys would raise errors about commands not existing, even though everything worked with the blocking client. Passing the commands to asyncio.RedisCluster.execute_command as uppercase strings fixed the problem.

This change makes sure that commands passed to asyncio.CommandsParser.get_keys are always uppercased when used with the self.commands dict. This behavior is consistent with the blocking client. I thought that the commands maybe should be uppercased before being passed to get_keys but I haven't been able to find any code that looks like it does that. For reference, I was using commands from a proprietary Redis module.

Copy link
Collaborator

@dvora-h dvora-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@falk-h Nice catch, thank you!

@dvora-h dvora-h merged commit 41b537d into redis:master Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants