conductor-sdk / conductor-python

Conductor OSS SDK for Python programming language
Apache License 2.0
52 stars 26 forks source link

TypeError: 'type' object is not subscriptable #247

Open andreapairon opened 4 months ago

andreapairon commented 4 months ago

Hello everyone, I get this error while importing the Worker class:

from conductor.client.worker.worker import Worker

../../.local/lib/python3.8/site-packages/conductor/client/worker/worker.py:14: in <module>

    from conductor.client.http.api_client import ApiClient

../../.local/lib/python3.8/site-packages/conductor/client/http/api_client.py:15: in <module>

    import conductor.client.http.models as http_models

../../.local/lib/python3.8/site-packages/conductor/client/http/models/__init__.py:34: in <module>

    from conductor.client.http.models.workflow_task import WorkflowTask

../../.local/lib/python3.8/site-packages/conductor/client/http/models/workflow_task.py:7: in <module>

    from conductor.client.http.models.state_change_event import StateChangeConfig, StateChangeEventType, StateChangeEvent

../../.local/lib/python3.8/site-packages/conductor/client/http/models/state_change_event.py:14: in <module>

    class StateChangeEvent:

../../.local/lib/python3.8/site-packages/conductor/client/http/models/state_change_event.py:25: in StateChangeEvent

    def __init__(self, type: str, payload: dict[str, object]) -> None:

E   TypeError: 'type' object is not subscriptable

I think because the class StateChangeEvent uses dict instead of Dict in his constructor:

err

With Python 3.9 I don't have that problem, only with Python 3.8.10.

This PR should solve it: https://github.com/conductor-sdk/conductor-python/pull/242

pyarun commented 1 month ago

facing same issue on python 3.8.16

anup-a commented 1 week ago

Any update on this @v1r3n ?

v1r3n commented 1 week ago

We are going to soon merge this: https://github.com/conductor-sdk/conductor-python/pull/242