HumanSignal/label-studio-sdk

Type Error while retrieving the tasks, tasks_ids from functions get_tasks(), get_tasks_ids()

GaneshDoosa opened this issue · 1 comments

While trying to get the list of tasks or tasks ids facing the following TypeError
Label Studio Version: 1.4

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-26-498b0b6e092f> in <module>
----> 1 task_ids = project.get_tasks_ids()
      2 task_ids

~/.virtualenvs/newenv/lib64/python3.6/site-packages/label_studio_sdk/project.py in get_tasks_ids(self, *args, **kwargs)
    710         """
    711         kwargs['only_ids'] = True
--> 712         return self.get_tasks(*args, **kwargs)
    713 
    714     def get_paginated_tasks_ids(self, *args, **kwargs):

~/.virtualenvs/newenv/lib64/python3.6/site-packages/label_studio_sdk/project.py in get_tasks(self, filters, ordering, view_id, selected_ids, only_ids)
    597                     only_ids=only_ids,
    598                     page=page,
--> 599                     page_size=100
    600                 )
    601                 result += data['tasks']

~/.virtualenvs/newenv/lib64/python3.6/site-packages/label_studio_sdk/project.py in get_paginated_tasks(self, filters, ordering, view_id, selected_ids, page, page_size, only_ids)
    700 
    701         data = response.json()
--> 702         tasks = data['tasks']
    703         if only_ids:
    704             data['tasks'] = [task['id'] for task in tasks]

TypeError: list indices must be integers or slices, not str


@GaneshDoosa Looks like you have mismatch between SDK and LS versions. Please, upgrade LS to the latest master branch or downgrade SDK to e.g. 0.0.9.