From a6546692a9d3eacf89a61b84933018a85527ee2f Mon Sep 17 00:00:00 2001 From: Vaghinak Basentsyan Date: Mon, 3 Mar 2025 11:59:47 +0400 Subject: [PATCH] Added jsonl option for prepare_export --- src/superannotate/__init__.py | 2 +- src/superannotate/lib/app/interface/sdk_interface.py | 5 ++++- src/superannotate/lib/infrastructure/annotation_adapter.py | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/superannotate/__init__.py b/src/superannotate/__init__.py index 2e4c077fa..d96b06007 100644 --- a/src/superannotate/__init__.py +++ b/src/superannotate/__init__.py @@ -3,7 +3,7 @@ import sys -__version__ = "4.4.32dev2" +__version__ = "4.4.32dev3" os.environ.update({"sa_version": __version__}) sys.path.append(os.path.split(os.path.realpath(__file__))[0]) diff --git a/src/superannotate/lib/app/interface/sdk_interface.py b/src/superannotate/lib/app/interface/sdk_interface.py index 2dfe694b6..0699fb981 100644 --- a/src/superannotate/lib/app/interface/sdk_interface.py +++ b/src/superannotate/lib/app/interface/sdk_interface.py @@ -1677,7 +1677,8 @@ def prepare_export( - integration_name: The name of the integration within the platform that is being used. - format: The format in which the data will be exported in multimodal projects. - It can be either CSV or JSON. If None, the data will be exported in the default JSON format. + The data can be exported in CSV, JSON, or JSONL format. If None, the data will be exported + in the default JSON format. :return: metadata object of the prepared export :rtype: dict @@ -1715,6 +1716,8 @@ def prepare_export( export_type = export_type.lower() if export_type == "csv": _export_type = 3 + elif export_type == "jsonl": + _export_type = 4 response = self.controller.prepare_export( project_name=project_name, folder_names=folders, diff --git a/src/superannotate/lib/infrastructure/annotation_adapter.py b/src/superannotate/lib/infrastructure/annotation_adapter.py index c333231cf..13436510a 100644 --- a/src/superannotate/lib/infrastructure/annotation_adapter.py +++ b/src/superannotate/lib/infrastructure/annotation_adapter.py @@ -44,7 +44,9 @@ def get_component_value(self, component_id: str): return None def set_component_value(self, component_id: str, value: Any): - self.annotation.setdefault("data", {}).setdefault(component_id, {})["value"] = value + self.annotation.setdefault("data", {}).setdefault(component_id, {})[ + "value" + ] = value return self