diff --git a/src/typesense/api_call.py b/src/typesense/api_call.py index 47d0eec..90e1929 100644 --- a/src/typesense/api_call.py +++ b/src/typesense/api_call.py @@ -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. @@ -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. @@ -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. @@ -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( @@ -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 diff --git a/tests/debug_test.py b/tests/debug_test.py index d491d17..4f13d5f 100644 --- a/tests/debug_test.py +++ b/tests/debug_test.py @@ -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)