File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def __init__(self,
43
43
client ,
44
44
project_id ,
45
45
* args ,
46
- failed_data_row_ids = None ,
46
+ failed_data_row_ids = [] ,
47
47
** kwargs ):
48
48
super ().__init__ (client , * args , ** kwargs )
49
49
self .project_id = project_id
@@ -187,6 +187,11 @@ def delete_labels(self, set_labels_as_template=False) -> None:
187
187
experimental = True )
188
188
return res
189
189
190
+ # modify this function to return an empty list if there are no failed data rows
191
+
190
192
@property
191
193
def failed_data_row_ids (self ):
194
+ if self ._failed_data_row_ids is None :
195
+ self ._failed_data_row_ids = []
196
+
192
197
return (x for x in self ._failed_data_row_ids )
Original file line number Diff line number Diff line change @@ -14,9 +14,17 @@ def get_data_row_ids(ds: Dataset):
14
14
15
15
16
16
def test_create_batch (project : Project , big_dataset_data_row_ids : List [str ]):
17
- batch = project .create_batch ("test-batch" , big_dataset_data_row_ids , 3 )
17
+ batch = project .create_batch ("test-batch" ,
18
+ big_dataset_data_row_ids ,
19
+ 3 ,
20
+ consensus_settings = {
21
+ 'number_of_labels' : 3 ,
22
+ 'coverage_percentage' : 0.1
23
+ })
24
+
18
25
assert batch .name == "test-batch"
19
26
assert batch .size == len (big_dataset_data_row_ids )
27
+ assert len ([dr for dr in batch .failed_data_row_ids ]) == 0
20
28
21
29
22
30
def test_create_batch_with_invalid_data_rows_ids (project : Project ):
@@ -101,6 +109,7 @@ def test_create_batch_async(project: Project,
101
109
priority = 3 )
102
110
assert batch .name == "big-batch"
103
111
assert batch .size == len (big_dataset_data_row_ids )
112
+ assert len ([dr for dr in batch .failed_data_row_ids ]) == 0
104
113
105
114
106
115
def test_create_batch_with_consensus_settings (project : Project ,
You can’t perform that action at this time.
0 commit comments