Skip to content

Commit 3b26955

Browse files
committed
AL-4081: Use generator for failed data rows
1 parent 72a801f commit 3b26955

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

labelbox/schema/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,4 @@ def delete_labels(self, set_labels_as_template=False) -> None:
183183

184184
@property
185185
def failed_data_row_ids(self):
186-
return self._failed_data_row_ids
186+
return (x for x in self._failed_data_row_ids)

tests/integration/test_batch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ def test_batch_creation_for_data_rows_with_issues(
111111
assert len(data_rows_to_add) == 5
112112
batch = batch_project.create_batch("batch to test failed data rows",
113113
data_rows_to_add)
114+
failed_data_row_ids = [x for x in batch.failed_data_row_ids]
115+
assert len(failed_data_row_ids) == 2
114116

115-
assert len(batch.failed_data_row_ids) == 2
116-
117-
failed_data_row_ids_set = set(batch.failed_data_row_ids)
117+
failed_data_row_ids_set = set(failed_data_row_ids)
118118
invalid_data_rows_set = set(invalid_data_rows)
119119
assert len(failed_data_row_ids_set.intersection(invalid_data_rows_set)) == 2
120120

0 commit comments

Comments
 (0)