thingsboard / thingsboard-python-rest-client

ThingsBoard REST API client
https://thingsboard.io/docs/reference/python-rest-client/
Apache License 2.0
79 stars 52 forks source link

Sample application fails: def load_user_group_permission_infos TypeError: 'type' object is not subscriptable #31

Closed thunfischbrot closed 3 years ago

thunfischbrot commented 3 years ago

Upgraded to the newest version using pip3 install --upgrade tb-rest-client

Running the example application results in the following error:

# python3 ./example_application_2.py 
Traceback (most recent call last):
  File "./example_application_2.py", line 5, in <module>
    from tb_rest_client.rest_client_pe import *
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/rest_client_pe.py", line 26, in <module>
    class RestClientPE(RestClientBase):
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/rest_client_pe.py", line 331, in RestClientPE
    def load_user_group_permission_infos(self, body: list[GroupPermission]):
TypeError: 'type' object is not subscriptable

This issue persists even if using tb_rest_client.rest_client_ce:

# python3 ./example_application_2.py 
Traceback (most recent call last):
  File "./example_application_2.py", line 5, in <module>
    from tb_rest_client.rest_client_ce import *
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/rest_client_ce.py", line 22, in <module>
    class RestClientCE(RestClientBase):
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/rest_client_ce.py", line 482, in RestClientCE
    def add_dashboard_customers(self, body: list[str], dashboard_id: DashboardId):
TypeError: 'type' object is not subscriptable

This issue persists even if using the latest master via # python3 -m pip install git+https://github.com/thingsboard/thingsboard-python-rest-client.

imbeacon commented 3 years ago

Please try to update again and check.