Skip to content

Conversation

petyaslavova
Copy link
Collaborator

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • 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)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Fixing #3455

Non-breaking change because the change from list to Union[KeyT, EncodableT] is for an internal/private method's argument type hint.

@petyaslavova petyaslavova requested a review from Copilot October 8, 2025 10:39
@petyaslavova petyaslavova added the maintenance Maintenance (CI, Releases, etc) label Oct 8, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes type hints for Redis Lua script execution commands by updating parameter type annotations from restrictive string types to more accurate Union types. The changes address issue #3455 and improve type safety without breaking existing functionality.

  • Updated *keys_and_args parameter type hints from str or list to Union[KeyT, EncodableT]
  • Applied consistent type annotations across all eval and evalsha methods
  • Reformatted method signatures for better readability
Comments suppressed due to low confidence (1)

redis/commands/core.py:1

  • The original type hint list for *keys_and_args in _evalsha method is incorrect. Variadic arguments (*args) cannot be typed as list - this would cause type checking errors. The fix to Union[KeyT, EncodableT] correctly represents the type of individual arguments.
# from __future__ import annotations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance (CI, Releases, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant