Skip to content

Commit 478c9fa

Browse files
committed
Ran yapf formatter
1 parent 48f7392 commit 478c9fa

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

labelbox/client.py

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

359360
request_data = {
360361
"operations":
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!,
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!,
369370
$sign: Boolean) {
370371
uploadFile(file: $file, contentLength: $contentLength,
371372
sign: $sign) {url filename} } """,
372-
}),
373+
}),
373374
"map": (None, json.dumps({"1": ["variables.file"]})),
374375
}
375376
response = requests.post(
@@ -378,7 +379,7 @@ def upload_data(self,
378379
data=request_data,
379380
files={
380381
"1": (filename, content, content_type) if
381-
(filename and content_type) else content
382+
(filename and content_type) else content
382383
})
383384

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

671673
return self._create(Entity.Project, {
672674
**kwargs,
@@ -778,7 +780,7 @@ def get_data_row_ids_for_external_ids(
778780
for row in self.execute(
779781
query_str,
780782
{'externalId_in': external_ids[i:i + max_ids_per_request]
781-
})['externalIdsToDataRowIds']:
783+
})['externalIdsToDataRowIds']:
782784
result[row['externalId']].append(row['dataRowId'])
783785
return result
784786

@@ -1070,9 +1072,10 @@ def _format_failed_rows(rows: Dict[str, str],
10701072
}
10711073
"""
10721074
params = {
1073-
'globalKeyDataRowLinks': [{
1074-
utils.camel_case(key): value for key, value in input.items()
1075-
} for input in global_key_to_data_row_inputs]
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]
10761079
}
10771080
assign_global_keys_to_data_rows_job = self.execute(query_str, params)
10781081

@@ -1101,8 +1104,8 @@ def _format_failed_rows(rows: Dict[str, str],
11011104
"""
11021105
result_params = {
11031106
"jobId":
1104-
assign_global_keys_to_data_rows_job["assignGlobalKeysToDataRows"
1105-
]["jobId"]
1107+
assign_global_keys_to_data_rows_job["assignGlobalKeysToDataRows"]
1108+
["jobId"]
11061109
}
11071110

11081111
# Poll job status until finished, then retrieve results
@@ -1218,7 +1221,7 @@ def _format_failed_rows(rows: List[str],
12181221
"""
12191222
result_params = {
12201223
"jobId":
1221-
data_rows_for_global_keys_job["dataRowsForGlobalKeys"]["jobId"]
1224+
data_rows_for_global_keys_job["dataRowsForGlobalKeys"]["jobId"]
12221225
}
12231226

12241227
# Poll job status until finished, then retrieve results
@@ -1340,7 +1343,8 @@ def _format_failed_rows(rows: List[str],
13401343
errors.extend(
13411344
_format_failed_rows(
13421345
data['notFoundGlobalKeys'],
1343-
"Failed to find data row matching provided global key"))
1346+
"Failed to find data row matching provided global key")
1347+
)
13441348
errors.extend(
13451349
_format_failed_rows(
13461350
data['accessDeniedGlobalKeys'],

0 commit comments

Comments
 (0)