conductor-python icon indicating copy to clipboard operation
conductor-python copied to clipboard

TypeError: 'type' object is not subscriptable

Open andreapairon opened this issue 1 year ago • 3 comments

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

andreapairon avatar Feb 05 '24 10:02 andreapairon

facing same issue on python 3.8.16

pyarun avatar May 22 '24 09:05 pyarun

Any update on this @v1r3n ?

anup-a avatar Jun 20 '24 06:06 anup-a

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

v1r3n avatar Jun 20 '24 07:06 v1r3n