Skip to content

Commit b42493c

Browse files
author
Dmitriy Apollonin
committed
pylint
1 parent b35518b commit b42493c

File tree

4 files changed

+40
-36
lines changed

4 files changed

+40
-36
lines changed

labelbox/schema/annotation_import.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ def _create_from_bytes(cls, client, variables, query_str, file_name,
144144
@classmethod
145145
def _get_ndjson_from_objects(cls, data, slug):
146146
if not isinstance(data, list):
147-
raise TypeError(f"{slug} must be in a form of list. Found {type(data)}")
147+
raise TypeError(
148+
f"{slug} must be in a form of list. Found {type(data)}")
148149

149150
data_str = ndjson.dumps(data)
150151
if not data_str:
@@ -208,8 +209,9 @@ def create_from_file(cls, client: "labelbox.Client", model_run_id: str,
208209
raise ValueError(f"File {path} is not accessible")
209210

210211
@classmethod
211-
def create_from_objects(cls, client: "labelbox.Client", model_run_id: str,
212-
name, predictions: List[Dict[str, Any]]) -> "MEAPredictionImport":
212+
def create_from_objects(
213+
cls, client: "labelbox.Client", model_run_id: str, name,
214+
predictions: List[Dict[str, Any]]) -> "MEAPredictionImport":
213215
"""
214216
Create an MEA prediction import job from an in memory dictionary
215217

labelbox/schema/bulk_import_request.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ def create_from_objects(cls,
311311
BulkImportRequest object
312312
"""
313313
if not isinstance(predictions, list):
314-
raise TypeError(f"annotations must be in a form of Iterable. Found {type(predictions)}")
314+
raise TypeError(
315+
f"annotations must be in a form of Iterable. Found {type(predictions)}"
316+
)
315317

316318
if validate:
317319
_validate_ndjson(predictions, client.get_project(project_id))

tests/unit/test_mal_import.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@ def test_invalid_labels_format():
4747
id = str(uuid.uuid4())
4848

4949
label = {
50-
"bbox": {
51-
"height": 428,
52-
"left": 2089,
53-
"top": 1251,
54-
"width": 158
55-
},
56-
"classifications": [{
57-
"answer": [{
58-
"schemaId": "ckrb1sfl8099e0y919v260awv",
59-
"confidence": 0.894
60-
}],
61-
"schemaId": "ckrb1sfkn099c0y910wbo0p1a"
50+
"bbox": {
51+
"height": 428,
52+
"left": 2089,
53+
"top": 1251,
54+
"width": 158
55+
},
56+
"classifications": [{
57+
"answer": [{
58+
"schemaId": "ckrb1sfl8099e0y919v260awv",
59+
"confidence": 0.894
6260
}],
63-
"dataRow": {
64-
"id": "ckrb1sf1i1g7i0ybcdc6oc8ct"
65-
},
66-
"schemaId": "ckrb1sfjx099a0y914hl319ie",
67-
"uuid": "d009925d-91a3-4f67-abd9-753453f5a584"
68-
}
61+
"schemaId": "ckrb1sfkn099c0y910wbo0p1a"
62+
}],
63+
"dataRow": {
64+
"id": "ckrb1sf1i1g7i0ybcdc6oc8ct"
65+
},
66+
"schemaId": "ckrb1sfjx099a0y914hl319ie",
67+
"uuid": "d009925d-91a3-4f67-abd9-753453f5a584"
68+
}
6969

7070
with patch.object(MALPredictionImport, '_create_mal_import_from_bytes'):
7171
with pytest.raises(TypeError):

tests/unit/test_unit_label_import.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ def test_invalid_labels_format():
4141
id = str(uuid.uuid4())
4242

4343
label = {
44-
"uuid": "b862c586-8614-483c-b5e6-82810f70cac0",
45-
"schemaId": "ckrazcueb16og0z6609jj7y3y",
46-
"dataRow": {
47-
"id": "ckrazctum0z8a0ybc0b0o0g0v"
48-
},
49-
"bbox": {
50-
"top": 1352,
51-
"left": 2275,
52-
"height": 350,
53-
"width": 139
54-
}
44+
"uuid": "b862c586-8614-483c-b5e6-82810f70cac0",
45+
"schemaId": "ckrazcueb16og0z6609jj7y3y",
46+
"dataRow": {
47+
"id": "ckrazctum0z8a0ybc0b0o0g0v"
48+
},
49+
"bbox": {
50+
"top": 1352,
51+
"left": 2275,
52+
"height": 350,
53+
"width": 139
5554
}
55+
}
5656
with patch.object(LabelImport, '_create_label_import_from_bytes'):
5757
with pytest.raises(TypeError):
5858
LabelImport.create_from_objects(client=MagicMock(),
59-
project_id=id,
60-
name=id,
61-
labels=label)
59+
project_id=id,
60+
name=id,
61+
labels=label)

0 commit comments

Comments
 (0)