Skip to content

Getting TypeError when importing AsyncClient or RealTimeClient objects #27

@savewater1

Description

@savewater1

Hi,

I am trying implement the example here and I am getting the following error:

Image

Upon inspecting the requirements.txt file, I can see that the requirement for python version is < 3.7.
When I checked the code for the API implementation, I found that the pipe operator '|' is being used to provide type hint for the value returned by the class method _get_http_response for both classes RealtimeAPI and AsyncAPI in api.py. This way of type hinting is only supported in python 3.10 or newer version which might be causing this error.

Recommended Solution: Either changing type hinting for the above mentioned methods to use Union type or updating the requirements file.

Just creating this ticket to bring this issue to light. I would be happy to create a pull-request with the fix.

P.S: It's my first time creating a GitHub issue so apologies for any mistakes. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions