Skip to content

Commit 03fba7a

Browse files
committed
update to remove some unnecessary parts of commit
1 parent e96036a commit 03fba7a

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

tests/data/serialization/ndjson/test_export_video_objects.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,6 @@ def video_serialized_bbox_label():
585585
}
586586

587587

588-
#ignore uuid because we randomize if there was none
589-
IGNORE_KEYS = ["uuid"]
590-
591-
592588
def test_serialize_video_objects():
593589
label = video_bbox_label()
594590
serialized_labels = NDJsonConverter.serialize([label])
@@ -597,7 +593,8 @@ def test_serialize_video_objects():
597593
manual_label = video_serialized_bbox_label()
598594

599595
for key in label.keys():
600-
if key not in IGNORE_KEYS:
596+
#ignore uuid because we randomize if there was none
597+
if key != "uuid":
601598
assert label[key] == manual_label[key]
602599

603600
assert len(label['segments']) == 2

tests/data/serialization/ndjson/test_image.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from labelbox.data.serialization.ndjson.converter import NDJsonConverter
66
from labelbox.data.annotation_types import Mask, Label, ObjectAnnotation, ImageData, MaskData
77

8-
IGNORE_KEYS = ['classifications']
9-
108

119
def round_dict(data):
1210
if isinstance(data, dict):
@@ -28,8 +26,7 @@ def test_image():
2826
res = NDJsonConverter.deserialize(data).as_list()
2927
res = list(NDJsonConverter.serialize(res))
3028
for r in res:
31-
for key in IGNORE_KEYS:
32-
r.pop(key, None)
29+
r.pop('classifications', None)
3330
assert [round_dict(x) for x in res] == [round_dict(x) for x in data]
3431

3532

@@ -41,8 +38,7 @@ def test_image_with_name_only():
4138
res = NDJsonConverter.deserialize(data).as_list()
4239
res = list(NDJsonConverter.serialize(res))
4340
for r in res:
44-
for key in IGNORE_KEYS:
45-
r.pop(key, None)
41+
r.pop('classifications', None)
4642
assert [round_dict(x) for x in res] == [round_dict(x) for x in data]
4743

4844

@@ -72,9 +68,7 @@ def test_mask():
7268
res = NDJsonConverter.deserialize(data).as_list()
7369
res = list(NDJsonConverter.serialize(res))
7470
for r in res:
75-
for key in IGNORE_KEYS:
76-
r.pop(key, None)
77-
71+
r.pop('classifications', None)
7872
assert [round_dict(x) for x in res] == [round_dict(x) for x in data]
7973

8074

tests/integration/annotation_import/test_bulk_import_request.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,36 @@ def test_pdf_mal_bbox(client, configured_project_pdf):
213213
"page": random.randint(0, 1),
214214
"unit": "POINTS"
215215
})
216+
annotations.extend([{
217+
'name': 'text',
218+
'answer': 'the answer to the text question',
219+
'uuid': 'fc1913c6-b735-4dea-bd25-c18152a4715f',
220+
"dataRow": {
221+
"id": row['id']
222+
}
223+
}, {
224+
'name':
225+
'checklist',
226+
'uuid':
227+
'9d7b2e57-d68f-4388-867a-af2a9b233719',
228+
"dataRow": {
229+
"id": row['id']
230+
},
231+
'answer': [{
232+
'name': 'first_checklist_answer'
233+
}, {
234+
'name': 'second_checklist_answer'
235+
}]
236+
}, {
237+
'name': 'radio',
238+
'answer': {
239+
'name': 'second_radio_answer'
240+
},
241+
'uuid': 'ad60897f-ea1a-47de-b923-459339764921',
242+
"dataRow": {
243+
"id": row['id']
244+
}
245+
}])
216246
import_annotations = MALPredictionImport.create_from_objects(
217247
client=client,
218248
project_id=configured_project_pdf.uid,

0 commit comments

Comments
 (0)