File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11import sys
22
33from typing import Optional
4+
5+ from labelbox .schema .media_type import MediaType
46if sys .version_info >= (3 , 8 ):
57 from typing import TypedDict
68else :
@@ -11,6 +13,7 @@ class DataRowParams(TypedDict):
1113 data_row_details : Optional [bool ]
1214 metadata_fields : Optional [bool ]
1315 attachments : Optional [bool ]
16+ media_type_override : Optional [MediaType ]
1417
1518
1619class ProjectExportParams (DataRowParams ):
Original file line number Diff line number Diff line change @@ -521,6 +521,8 @@ def export_v2(self,
521521 "modelRunId" : self .uid
522522 },
523523 "params" : {
524+ "mediaTypeOverride" :
525+ _params .get ('media_type_override' , None ),
524526 "includeAttachments" :
525527 _params .get ('attachments' , False ),
526528 "includeMetadata" :
Original file line number Diff line number Diff line change @@ -430,7 +430,8 @@ def export_v2(self,
430430 "data_row_details" : False ,
431431 "project_details" : False ,
432432 "performance_details" : False ,
433- "label_details" : False
433+ "label_details" : False ,
434+ "media_type_override" : None
434435 })
435436
436437 _filters = filters or ProjectExportFilters ({
@@ -451,6 +452,7 @@ def _get_timezone() -> str:
451452 """ % (mutation_name )
452453
453454 search_query : List [Dict [str , Collection [str ]]] = []
455+ media_type_override = _params .get ('media_type_override' , None )
454456 query_params = {
455457 "input" : {
456458 "taskName" : task_name ,
@@ -462,6 +464,9 @@ def _get_timezone() -> str:
462464 }
463465 },
464466 "params" : {
467+ "mediaTypeOverride" :
468+ media_type_override .value
469+ if media_type_override is not None else None ,
465470 "includeAttachments" :
466471 _params .get ('attachments' , False ),
467472 "includeMetadata" :
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ def test_project_export_v2(configured_project_with_label):
5959 },
6060 params = {
6161 "include_performance_details" : include_performance_details ,
62- "include_labels" : True
62+ "include_labels" : True ,
63+ "media_type_override" : MediaType .Image
6364 })
6465
6566 task_to = project .export_v2 (
You can’t perform that action at this time.
0 commit comments