Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project.get_labeled_tasks API returns BROKEN json #5286

Open
avloss opened this issue Jan 12, 2024 · 3 comments
Open

project.get_labeled_tasks API returns BROKEN json #5286

avloss opened this issue Jan 12, 2024 · 3 comments
Labels
community:bug Triaged by the community team + confirmed to be bug. community:issue A community reported issue community:reviewed Issue has been reviewed by the Label Studio Community Team.

Comments

@avloss
Copy link

avloss commented Jan 12, 2024

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:
c65330c0#diff-7ce60240b37e69943356ab25fe22bef989b3eed3066f58372bdfd8edb029b6dbR222

To Reproduce

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.

@hogepodge
Copy link
Contributor

HI @avloss I'm going to look into this with the dev team today

@hogepodge hogepodge added community:reviewed Issue has been reviewed by the Label Studio Community Team. community:issue A community reported issue labels Jan 18, 2024
@hogepodge
Copy link
Contributor

I've confirmed this is a bug. I'm filing a ticket with the dev team to be scheduled for review.

@hogepodge hogepodge added the community:bug Triaged by the community team + confirmed to be bug. label Jan 18, 2024
@KBlansit
Copy link

Is there any update on this? I have been running into the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community:bug Triaged by the community team + confirmed to be bug. community:issue A community reported issue community:reviewed Issue has been reviewed by the Label Studio Community Team.
Projects
None yet
Development

No branches or pull requests

3 participants