HumanSignal/label-studio-sdk

BUG: task export broken for yolo format and all other non json formats

Gornoka opened this issue · 2 comments

Behaviour

The export tasks endpoint is broken when using the Yolo format.

r = project.export_tasks(export_type="YOLO")

fails with

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Assumed cause

I assume that this is due to the result of the endpoint being a zip archive and not a Json formatted string, which is assumed in https://github.com/heartexlabs/label-studio-sdk/blob/506fece22b463ef36c7cdc54c41eda214d6f0992/label_studio_sdk/project.py#L563 .

Preferred resolution

I would prefer to be able to specify a file path or buffer where to store/ write the zipfile to.

For now, I just send the request manually, so this does not block me.

Could you contribute the fix please?

The error appears to affect almost all exports, except for json and json_min, see https://gist.github.com/Gornoka/b94b376524d46eaacbc4999b1d0378cc for a quick test.