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

CI: Fix lint-python after Redis v5.0.0 release #226

Merged
merged 1 commit into from
Sep 1, 2023
Merged

Conversation

psrok1
Copy link
Member

@psrok1 psrok1 commented Sep 1, 2023

Redis-py laziness in defining types results in the following errors:

karton/core/backend.py:276: error: Argument 2 to "unserialize_bind" of "KartonBackend" has incompatible type "Union[Awaitable[Optional[str]], str, None]"; expected "str"
karton/core/backend.py:287: error: Item "Awaitable[Dict[Any, Any]]" of "Union[Awaitable[Dict[Any, Any]], Dict[Any, Any]]" has no attribute "items"
karton/core/backend.py:287: note: Maybe you forgot to use "await"?
karton/core/backend.py:312: error: Argument 2 to "hdel" of "HashCommands" has incompatible type "str"; expected "List[Any]"
karton/core/backend.py:334: error: Item "Awaitable[Any]" of "Union[Awaitable[Any], Any]" has no attribute "__iter__" (not iterable)
karton/core/backend.py:355: error: Item "Awaitable[Any]" of "Union[Awaitable[Any], Any]" has no attribute "__iter__" (not iterable)
karton/core/backend.py:378: error: Argument 1 to "unserialize" of "Task" has incompatible type "Union[Awaitable[Any], Any]"; expected "Union[str, bytes]"
karton/core/backend.py:405: error: Item "Awaitable[Any]" of "Union[Awaitable[Any], Any]" has no attribute "__iter__" (not iterable)
karton/core/backend.py:420: error: Item "Awaitable[Any]" of "Union[Awaitable[Any], Any]" has no attribute "__iter__" (not iterable)
karton/core/backend.py:559: error: Argument 1 to "get_tasks" of "KartonBackend" has incompatible type "Union[Awaitable[List[Any]], List[Any]]"; expected "List[str]"
karton/core/backend.py:568: error: Incompatible return value type (got "Union[Awaitable[List[Any]], List[Any]]", expected "List[str]")
karton/core/backend.py:626: error: Incompatible return value type (got "Union[Awaitable[List[Any]], List[Any]]", expected "Optional[Tuple[str, str]]")
karton/core/backend.py:626: error: Argument 1 to "blpop" of "ListCommands" has incompatible type "Union[str, List[str]]"; expected "List[Any]"
karton/core/backend.py:717: error: Unsupported operand types for < ("int" and "Awaitable[Any]")
karton/core/backend.py:717: note: Left operand is of type "Union[Awaitable[Any], Any]"
karton/core/backend.py:806: error: Item "Awaitable[Dict[Any, Any]]" of "Union[Awaitable[Dict[Any, Any]], Dict[Any, Any]]" has no attribute "items"
karton/core/backend.py:806: note: Maybe you forgot to use "await"?
karton/core/backend.py:944: error: Argument 2 to "unserialize_output" of "KartonBackend" has incompatible type "Union[Awaitable[Set[Any]], Set[Any]]"; expected "Set[str]"
karton/core/backend.py:946: error: Item "Awaitable[Any]" of "Union[Awaitable[Any], Any]" has no attribute "__iter__" (not iterable)

As a temporary workaround, I would pin to redis<5.0.0 for linting and fix it somehow in the next versions.

@psrok1 psrok1 requested a review from msm-code September 1, 2023 14:48
@psrok1 psrok1 merged commit 5e5c306 into master Sep 1, 2023
@psrok1 psrok1 deleted the fix/lint-redis branch September 1, 2023 16:39
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 this pull request may close these issues.

1 participant