@@ -4050,7 +4050,11 @@ async def __download(base_path: Path, _obj: dict):
40504050 exist_dataset_objects = json .load (open (output_path ))
40514051 with Path (base_path / "annotations.json" ).open ("w" ) as f :
40524052 annotations = [
4053- {"name" : obj ["name" ], "annotations" : obj ["annotations" ]}
4053+ {
4054+ "name" : obj ["name" ],
4055+ "annotations" : obj ["annotations" ],
4056+ "customMetadata" : obj ["customMetadata" ],
4057+ }
40544058 for obj in objects
40554059 ]
40564060 json .dump (
@@ -4076,6 +4080,7 @@ def create_dataset_object(
40764080 file_path : str ,
40774081 tags : List [str ] = None ,
40784082 annotations : List [dict ] = None ,
4083+ custom_metadata : Optional [dict [str , str ]] = None ,
40794084 ) -> dict :
40804085 """
40814086 Create a dataset object.
@@ -4102,6 +4107,8 @@ def create_dataset_object(
41024107 payload ["tags" ] = tags
41034108 if annotations :
41044109 payload ["annotations" ] = annotations
4110+ if custom_metadata :
4111+ payload ["customMetadata" ] = custom_metadata
41054112 return self .api .post_request (endpoint , payload = payload )
41064113
41074114 def delete_dataset_object (self , dataset_id : str , object_name : str ) -> None :
@@ -4418,6 +4425,7 @@ def get_histories(
44184425
44194426 return self .api .get_request (endpoint , params = params )
44204427
4428+
44214429def delete_extra_annotations_parameter (annotations : list ) -> list :
44224430 for annotation in annotations :
44234431 annotation .pop ("id" , None )
@@ -4437,4 +4445,4 @@ def delete_extra_attributes_parameter(attributes: list) -> list:
44374445 attribute .pop ("title" , None )
44384446 attribute .pop ("name" , None )
44394447 attribute .pop ("type" , None )
4440- return attributes
4448+ return attributes
0 commit comments