2626import  tarfile 
2727import  tempfile 
2828import  time 
29+ import  urllib .parse 
2930import  uuid 
3031import  warnings 
3132from  typing  import  Dict , Optional , Tuple 
3233
3334import  pandas  as  pd 
34- import  urllib .parse 
3535import  yaml 
3636
3737from  . import  api , constants , exceptions , utils 
@@ -922,7 +922,7 @@ def create_inference_pipeline(
922922 {"task_type" : task_type .value , ** reference_dataset_config }
923923 )
924924
925-  with  tempfile .TemporaryDirectory () as  tmp_dir :  
925+  with  tempfile .TemporaryDirectory () as  tmp_dir :
926926 # Copy relevant files to tmp dir if reference dataset is provided 
927927 if  reference_dataset_config_file_path  is  not None :
928928 utils .write_yaml (
@@ -1135,9 +1135,7 @@ def publish_batch_data(
11351135 with  tarfile .open (tar_file_path , mode = "w:gz" ) as  tar :
11361136 tar .add (tmp_dir , arcname = os .path .basename ("batch_data" ))
11371137
1138-  payload  =  {
1139-  "performGroundTruthMerge" : False ,
1140-  }
1138+  payload  =  {"performGroundTruthMerge" : False }
11411139
11421140 presigned_url_query_params_dict  =  {
11431141 "earliestTimestamp" : int (earliest_timestamp ),
@@ -1157,8 +1155,10 @@ def publish_batch_data(
11571155 body = payload ,
11581156 storage_uri_key = "storageUri" ,
11591157 method = "POST" ,
1160-  presigned_url_endpoint = f"inference-pipelines/{ inference_pipeline_id }  ,
1161-  presigned_url_query_params = presigned_url_query_params 
1158+  presigned_url_endpoint = (
1159+  f"inference-pipelines/{ inference_pipeline_id }  
1160+  ),
1161+  presigned_url_query_params = presigned_url_query_params ,
11621162 )
11631163
11641164 print ("Batch of data published!" )
@@ -1232,6 +1232,6 @@ def publish_ground_truths(
12321232 storage_uri_key = "storageUri" ,
12331233 method = "POST" ,
12341234 presigned_url_endpoint = f"inference-pipelines/{ inference_pipeline_id }  ,
1235-  presigned_url_query_params = presigned_url_query_params 
1235+  presigned_url_query_params = presigned_url_query_params , 
12361236 )
12371237 print ("Ground truths published!" )
0 commit comments