Skip to content

Commit 32fe56e

Browse files
committed
Revert back to TypedDict
1 parent 7506bd0 commit 32fe56e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

labelbox/schema/export_params.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
from typing import Optional
24
if sys.version_info >= (3, 8):
35
from typing import TypedDict
@@ -14,7 +16,7 @@ class DataRowParams(TypedDict):
1416

1517
class ProjectExportParams(DataRowParams):
1618
project_details: Optional[bool]
17-
label_details: Optional[bool]
19+
labels: Optional[bool]
1820
performance_details: Optional[bool]
1921

2022

labelbox/schema/project.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,21 @@ def _validate_datetime(string_date: str) -> bool:
384384

385385
def export_v2(self, task_name: str,
386386
params: Optional[ProjectExportParams]) -> Task:
387-
_params = params or {}
387+
defaultParams: ProjectExportParams = {
388+
"attachments": False,
389+
"media_attributes": False,
390+
"metadata_fields": False,
391+
"data_row_details": False,
392+
"project_details": False,
393+
"labels": False,
394+
"performance_details": False
395+
}
396+
_params: ProjectExportParams = params if params is not None else defaultParams
388397
mutation_name = "exportDataRowsInProject"
389398
create_task_query_str = """mutation exportDataRowsInProjectPyApi($input: ExportDataRowsInProjectInput!){
390399
%s(input: $input) {taskId} }
391400
""" % (mutation_name)
392-
params = {
401+
query_params = {
393402
"input": {
394403
"taskName": task_name,
395404
"filters": {
@@ -415,7 +424,7 @@ def export_v2(self, task_name: str,
415424
}
416425
res = self.client.execute(
417426
create_task_query_str,
418-
params,
427+
query_params,
419428
)
420429
res = res[mutation_name]
421430
task_id = res["taskId"]

0 commit comments

Comments
 (0)