Skip to content

Fix reported type of decorator #956

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

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions meilisearch/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import json
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable
from typing import TYPE_CHECKING, Any, Callable, TypeVar

from requests import Response

Expand All @@ -11,6 +11,8 @@
from meilisearch.index import Index
from meilisearch.task import TaskHandler

T = TypeVar("T")


class MeilisearchError(Exception): # pragma: no cover
"""Generic class for Meilisearch error handling"""
Expand Down Expand Up @@ -63,7 +65,7 @@ def __str__(self) -> str: # pragma: no cover
return f"MeilisearchTimeoutError, {self.message}"


def version_error_hint_message(func: Callable) -> Any:
def version_error_hint_message(func: Callable[..., T]) -> Callable[..., T]:
@wraps(func)
def wrapper(*args: Any, **kwargs: Any) -> Any:
try:
Expand Down