@@ -1723,14 +1723,17 @@ def _upload_items(
17231723 local_file_upload_concurrency = local_file_upload_concurrency ,
17241724 )
17251725
1726- def update_scene_metadata (self , mapping : Dict [str , dict ]):
1726+ def update_scene_metadata (
1727+ self , mapping : Dict [str , dict ], asynchronous : bool = False
1728+ ):
17271729 """
17281730 Update (merge) scene metadata for each reference_id given in the mapping.
17291731 The backend will join the specified mapping metadata to the existing metadata.
17301732 If there is a key-collision, the value given in the mapping will take precedence.
17311733
17321734 Args:
17331735 mapping: key-value pair of <reference_id>: <metadata>
1736+ asynchronous: if True, run the update as a background job
17341737
17351738 Examples:
17361739 >>> mapping = {"scene_ref_1": {"new_key": "foo"}, "scene_ref_2": {"some_value": 123}}
@@ -1740,11 +1743,17 @@ def update_scene_metadata(self, mapping: Dict[str, dict]):
17401743 A dictionary outlining success or failures.
17411744 """
17421745 mm = MetadataManager (
1743- self .id , self ._client , mapping , ExportMetadataType .SCENES
1746+ self .id ,
1747+ self ._client ,
1748+ mapping ,
1749+ ExportMetadataType .SCENES ,
1750+ asynchronous ,
17441751 )
17451752 return mm .update ()
17461753
1747- def update_item_metadata (self , mapping : Dict [str , dict ]):
1754+ def update_item_metadata (
1755+ self , mapping : Dict [str , dict ], asynchronous : bool = False
1756+ ):
17481757 """
17491758 Update (merge) dataset item metadata for each reference_id given in the mapping.
17501759 The backend will join the specified mapping metadata to the existing metadata.
@@ -1755,6 +1764,7 @@ def update_item_metadata(self, mapping: Dict[str, dict]):
17551764
17561765 Args:
17571766 mapping: key-value pair of <reference_id>: <metadata>
1767+ asynchronous: if True, run the update as a background job
17581768
17591769 Examples:
17601770 >>> mapping = {"item_ref_1": {"new_key": "foo"}, "item_ref_2": {"some_value": 123, "camera_params": {...}}}
@@ -1764,7 +1774,11 @@ def update_item_metadata(self, mapping: Dict[str, dict]):
17641774 A dictionary outlining success or failures.
17651775 """
17661776 mm = MetadataManager (
1767- self .id , self ._client , mapping , ExportMetadataType .DATASET_ITEMS
1777+ self .id ,
1778+ self ._client ,
1779+ mapping ,
1780+ ExportMetadataType .DATASET_ITEMS ,
1781+ asynchronous ,
17681782 )
17691783 return mm .update ()
17701784
0 commit comments