HumanSignal / HumanSignal/label-studio
project.get_labeled_tasks API returns BROKEN json
- Dominant language
- TypeScript
- Stars
- 28.3k
- Forks
- 3.7k
- Avg merge
- 14h
- Merged PRs (30d)
- 15
Description
**Describe the bug**
NB: This could be a "feature" and not a "bug" since how obviously it is "broken". Perhaps I'm mis-using API and have wrong expectations of it.
This commit line deliberately breaks parsable json:
https://github.com/HumanSignal/label-studio/commit/c65330c0#diff-7ce60240b37e69943356ab25fe22bef989b3eed3066f58372bdfd8edb029b6dbR222
**To Reproduce**
```python
from label_studio_sdk import Client
import json
LABEL_STUDIO_URL = 'http://localhost:8080'
API_KEY = '***'
ls = Client(url=LABEL_STUDIO_URL, api_key=API_KEY)
json.loads(ls.get_project(1).get_labeled_tasks()[0]['annotations_results'])
>JSONDecodeError
```
**Expected behavior**
json is parsed
**Additional context**
I understand the motivation of that PR, which was to "speed up" slow execution. Changes like "json -> ujson" were introduced. But at the same time, modifying "annotations_results" field this way makes it practically unusable. Perhaps the intention that this API would be used in UI, and NOT for accessing "annotations_results" programmatically. If that's the case - then perhaps there should be alternative way to retrieve FULL results, perhaps with pagination.
Contributor guide
Assessment
This issue has not been assessed yet.