label-studio-sdk
label-studio-sdk copied to clipboard
Task lists produce annotations with None
tasks = client.tasks.list(project="1")
for task in tasks:
print( task.data['username'] )
print( task.annotations )
when running this code, task.annotations is printed as None
, but with the following workaround I am able to get the annotations:
tasks = client.tasks.list(project="1")
for task in tasks:
print( task.data['username'] )
annotations = client._client_wrapper.httpx_client.request(f"api/tasks/{task.id}/annotations/", method="GET").json()
print( annotations )
Looking at the code, most likely I should have defined fields = "all"
on the client.tasks.list
for them not to be None
, but this is not the specified in short the documentation. If I could choose, I would instead change the default of client.tasks.list
as fields ="all"
to simplify the API use.