26
26
import tarfile
27
27
import tempfile
28
28
import time
29
+ import urllib .parse
29
30
import uuid
30
31
import warnings
31
32
from typing import Dict , Optional , Tuple
32
33
33
34
import pandas as pd
34
- import urllib .parse
35
35
import yaml
36
36
37
37
from . import api , constants , exceptions , utils
@@ -922,7 +922,7 @@ def create_inference_pipeline(
922
922
{"task_type" : task_type .value , ** reference_dataset_config }
923
923
)
924
924
925
- with tempfile .TemporaryDirectory () as tmp_dir :
925
+ with tempfile .TemporaryDirectory () as tmp_dir :
926
926
# Copy relevant files to tmp dir if reference dataset is provided
927
927
if reference_dataset_config_file_path is not None :
928
928
utils .write_yaml (
@@ -1135,9 +1135,7 @@ def publish_batch_data(
1135
1135
with tarfile .open (tar_file_path , mode = "w:gz" ) as tar :
1136
1136
tar .add (tmp_dir , arcname = os .path .basename ("batch_data" ))
1137
1137
1138
- payload = {
1139
- "performGroundTruthMerge" : False ,
1140
- }
1138
+ payload = {"performGroundTruthMerge" : False }
1141
1139
1142
1140
presigned_url_query_params_dict = {
1143
1141
"earliestTimestamp" : int (earliest_timestamp ),
@@ -1157,8 +1155,10 @@ def publish_batch_data(
1157
1155
body = payload ,
1158
1156
storage_uri_key = "storageUri" ,
1159
1157
method = "POST" ,
1160
- presigned_url_endpoint = f"inference-pipelines/{ inference_pipeline_id } /presigned-url" ,
1161
- presigned_url_query_params = presigned_url_query_params
1158
+ presigned_url_endpoint = (
1159
+ f"inference-pipelines/{ inference_pipeline_id } /presigned-url"
1160
+ ),
1161
+ presigned_url_query_params = presigned_url_query_params ,
1162
1162
)
1163
1163
1164
1164
print ("Batch of data published!" )
@@ -1232,6 +1232,6 @@ def publish_ground_truths(
1232
1232
storage_uri_key = "storageUri" ,
1233
1233
method = "POST" ,
1234
1234
presigned_url_endpoint = f"inference-pipelines/{ inference_pipeline_id } /presigned-url" ,
1235
- presigned_url_query_params = presigned_url_query_params
1235
+ presigned_url_query_params = presigned_url_query_params ,
1236
1236
)
1237
1237
print ("Ground truths published!" )
0 commit comments