Skip to content

Commit 436a25b

Browse files
committed
Ran linter
1 parent 345f016 commit 436a25b

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

labelbox/client.py

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ def convert_value(value):
157157
if query is not None:
158158
if params is not None:
159159
params = {
160-
key: convert_value(value)
161-
for key, value in params.items()
160+
key: convert_value(value) for key, value in params.items()
162161
}
163162
data = json.dumps({
164163
'query': query,
@@ -359,18 +358,18 @@ def upload_data(self,
359358

360359
request_data = {
361360
"operations":
362-
json.dumps({
363-
"variables": {
364-
"file": None,
365-
"contentLength": len(content),
366-
"sign": sign
367-
},
368-
"query":
369-
"""mutation UploadFile($file: Upload!, $contentLength: Int!,
361+
json.dumps({
362+
"variables": {
363+
"file": None,
364+
"contentLength": len(content),
365+
"sign": sign
366+
},
367+
"query":
368+
"""mutation UploadFile($file: Upload!, $contentLength: Int!,
370369
$sign: Boolean) {
371370
uploadFile(file: $file, contentLength: $contentLength,
372371
sign: $sign) {url filename} } """,
373-
}),
372+
}),
374373
"map": (None, json.dumps({"1": ["variables.file"]})),
375374
}
376375
response = requests.post(
@@ -379,7 +378,7 @@ def upload_data(self,
379378
data=request_data,
380379
files={
381380
"1": (filename, content, content_type) if
382-
(filename and content_type) else content
381+
(filename and content_type) else content
383382
})
384383

385384
if response.status_code == 502:
@@ -667,8 +666,7 @@ def create_project(self, **kwargs) -> Project:
667666
elif queue_mode == QueueMode.Dataset:
668667
logger.warning(
669668
"QueueMode.Dataset will eventually be deprecated, and is no longer "
670-
"recommended for new projects. Prefer QueueMode.Batch instead."
671-
)
669+
"recommended for new projects. Prefer QueueMode.Batch instead.")
672670

673671
return self._create(Entity.Project, {
674672
**kwargs,
@@ -780,7 +778,7 @@ def get_data_row_ids_for_external_ids(
780778
for row in self.execute(
781779
query_str,
782780
{'externalId_in': external_ids[i:i + max_ids_per_request]
783-
})['externalIdsToDataRowIds']:
781+
})['externalIdsToDataRowIds']:
784782
result[row['externalId']].append(row['dataRowId'])
785783
return result
786784

@@ -1072,10 +1070,9 @@ def _format_failed_rows(rows: Dict[str, str],
10721070
}
10731071
"""
10741072
params = {
1075-
'globalKeyDataRowLinks':
1076-
[{utils.camel_case(key): value
1077-
for key, value in input.items()}
1078-
for input in global_key_to_data_row_inputs]
1073+
'globalKeyDataRowLinks': [{
1074+
utils.camel_case(key): value for key, value in input.items()
1075+
} for input in global_key_to_data_row_inputs]
10791076
}
10801077
assign_global_keys_to_data_rows_job = self.execute(query_str, params)
10811078

@@ -1104,8 +1101,8 @@ def _format_failed_rows(rows: Dict[str, str],
11041101
"""
11051102
result_params = {
11061103
"jobId":
1107-
assign_global_keys_to_data_rows_job["assignGlobalKeysToDataRows"]
1108-
["jobId"]
1104+
assign_global_keys_to_data_rows_job["assignGlobalKeysToDataRows"
1105+
]["jobId"]
11091106
}
11101107

11111108
# Poll job status until finished, then retrieve results
@@ -1221,7 +1218,7 @@ def _format_failed_rows(rows: List[str],
12211218
"""
12221219
result_params = {
12231220
"jobId":
1224-
data_rows_for_global_keys_job["dataRowsForGlobalKeys"]["jobId"]
1221+
data_rows_for_global_keys_job["dataRowsForGlobalKeys"]["jobId"]
12251222
}
12261223

12271224
# Poll job status until finished, then retrieve results
@@ -1343,8 +1340,7 @@ def _format_failed_rows(rows: List[str],
13431340
errors.extend(
13441341
_format_failed_rows(
13451342
data['notFoundGlobalKeys'],
1346-
"Failed to find data row matching provided global key")
1347-
)
1343+
"Failed to find data row matching provided global key"))
13481344
errors.extend(
13491345
_format_failed_rows(
13501346
data['accessDeniedGlobalKeys'],

0 commit comments

Comments
 (0)