Skip to content

Conversation

@tharropoulos
Copy link
Contributor

Change Summary

This pull request includes changes to the src/typesense/api_call.py file to address types errors for keyword arguments in several methods. The changes replace the use of typing.Unpack with typing.Any for the **kwargs parameter in multiple methods.

Mypy can't decipher that the imported type is indeed extending a TypedDict, resulting in mypy errors on CI.

  • src/typesense/api_call.py: Modified the **kwargs parameter in the _execute_request method to use typing.Any instead of typing.Unpack[SessionFunctionKwargs[TParams, TBody]] for three different method signatures. [1] [2] [3]
  • src/typesense/api_call.py: Modified the **kwargs parameter in the _make_request_and_process_response method to use typing.Any instead of typing.Unpack[SessionFunctionKwargs[TParams, TBody]].

PR Checklist

mypy doesn't infer the typed dict type correctly, resulting in type
errors, this isn't ideal.
- Check for existence of keys and assert their types, instead of
checking for their values
@tharropoulos tharropoulos changed the title chore: cast kwargs as any in api call module chore: use SessionFunctionKwargs directly instead of unpacking Feb 19, 2025
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.

2 participants