Skip to content
Closed
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions src/typesense/api_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def _execute_request(
as_json: typing.Literal[True],
last_exception: typing.Union[None, Exception] = None,
num_retries: int = 0,
**kwargs: typing.Unpack[SessionFunctionKwargs[TParams, TBody]],
**kwargs: SessionFunctionKwargs[TParams, TBody],
) -> TEntityDict:
"""
Execute a request to the Typesense API with retry logic.
Expand Down Expand Up @@ -373,7 +373,7 @@ def _execute_request(
as_json: typing.Literal[False],
last_exception: typing.Union[None, Exception] = None,
num_retries: int = 0,
**kwargs: typing.Unpack[SessionFunctionKwargs[TParams, TBody]],
**kwargs: SessionFunctionKwargs[TParams, TBody],
) -> str:
"""
Execute a request to the Typesense API with retry logic.
Expand Down Expand Up @@ -411,7 +411,7 @@ def _execute_request(
as_json: typing.Union[typing.Literal[True], typing.Literal[False]] = True,
last_exception: typing.Union[None, Exception] = None,
num_retries: int = 0,
**kwargs: typing.Unpack[SessionFunctionKwargs[TParams, TBody]],
**kwargs: SessionFunctionKwargs[TParams, TBody],
) -> typing.Union[TEntityDict, str]:
"""
Execute a request to the Typesense API with retry logic.
Expand Down Expand Up @@ -473,7 +473,7 @@ def _make_request_and_process_response(
url: str,
entity_type: typing.Type[TEntityDict],
as_json: bool,
**kwargs: typing.Any,
**kwargs: SessionFunctionKwargs[TParams, TBody],
) -> typing.Union[TEntityDict, str]:
"""Make the API request and process the response."""
request_response = self.request_handler.make_request(
Expand All @@ -493,7 +493,7 @@ def _make_request_and_process_response(
def _prepare_request_params(
self,
endpoint: str,
**kwargs: typing.Unpack[SessionFunctionKwargs[TParams, TBody]],
**kwargs: SessionFunctionKwargs[TParams, TBody],
) -> typing.Tuple[Node, str, SessionFunctionKwargs[TParams, TBody]]:
node = self.node_manager.get_node()
url = node.url() + endpoint
Expand Down
10 changes: 6 additions & 4 deletions tests/debug_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ def test_retrieve(fake_debug: Debug) -> None:


def test_actual_retrieve(actual_debug: Debug) -> None:
"""Test that the Debug object can retrieve a debug on Typesense server."""
json_response: DebugResponseSchema = {"state": 1, "version": "27.0"}

"""Test that the Debug object can retrieve a debug on Typesense server and verify response structure."""
response = actual_debug.retrieve()

assert response == json_response
assert "state" in response
assert "version" in response

assert isinstance(response["state"], int)
assert isinstance(response["version"], str)