@@ -1127,10 +1127,6 @@ def validate_labeling_parameter_overrides(self, data) -> None:
11271127 raise TypeError (
11281128 f"Priority must be an int. Found { type (priority )} for data_row { data_row } . Index: { idx } "
11291129 )
1130- if priority < 1 :
1131- raise ValueError (
1132- f"Priority must be greater than 0 for data_row { data_row } . Index: { idx } "
1133- )
11341130
11351131 def set_labeling_parameter_overrides (self , data ) -> bool :
11361132 """ Adds labeling parameter overrides to this project.
@@ -1143,26 +1139,21 @@ def set_labeling_parameter_overrides(self, data) -> bool:
11431139
11441140 Args:
11451141 data (iterable): An iterable of tuples. Each tuple must contain
1146- (DataRow, priority<int>, number_of_labels<int> ) for the new override.
1142+ (DataRow, priority<int>) for the new override.
11471143
11481144 Priority:
11491145 * Data will be labeled in priority order.
11501146 - A lower number priority is labeled first.
1151- - Minimum priority is 1 .
1147+ - All signed 32-bit integers are accepted, from -2147483648 to 2147483647 .
11521148 * Priority is not the queue position.
11531149 - The position is determined by the relative priority.
11541150 - E.g. [(data_row_1, 5,1), (data_row_2, 2,1), (data_row_3, 10,1)]
11551151 will be assigned in the following order: [data_row_2, data_row_1, data_row_3]
1156- * Datarows with parameter overrides will appear before datarows without overrides.
11571152 * The priority only effects items in the queue.
11581153 - Assigning a priority will not automatically add the item back into the queue.
11591154 Returns:
11601155 bool, indicates if the operation was a success.
11611156 """
1162- logger .warning (
1163- "LabelingParameterOverrides are deprecated for new projects, and will eventually be removed "
1164- "completely. Prefer to use batch based queuing with priority & consensus number of labels instead."
1165- )
11661157 data = [t [:2 ] for t in data ]
11671158 self .validate_labeling_parameter_overrides (data )
11681159 data_str = ",\n " .join ("{dataRow: {id: \" %s\" }, priority: %d }" %
@@ -1175,25 +1166,6 @@ def set_labeling_parameter_overrides(self, data) -> bool:
11751166 res = self .client .execute (query_str , {id_param : self .uid })
11761167 return res ["project" ]["setLabelingParameterOverrides" ]["success" ]
11771168
1178- def unset_labeling_parameter_overrides (self , data_rows ) -> bool :
1179- """ Removes labeling parameter overrides to this project.
1180-
1181- * This will remove unlabeled duplicates in the queue.
1182-
1183- Args:
1184- data_rows (iterable): An iterable of DataRows.
1185- Returns:
1186- bool, indicates if the operation was a success.
1187- """
1188- id_param = "projectId"
1189- query_str = """mutation UnsetLabelingParameterOverridesPyApi($%s: ID!){
1190- project(where: { id: $%s}) {
1191- unsetLabelingParameterOverrides(data: [%s]) { success }}}""" % (
1192- id_param , id_param , ",\n " .join (
1193- "{dataRowId: \" %s\" }" % row .uid for row in data_rows ))
1194- res = self .client .execute (query_str , {id_param : self .uid })
1195- return res ["project" ]["unsetLabelingParameterOverrides" ]["success" ]
1196-
11971169 def upsert_review_queue (self , quota_factor ) -> None :
11981170 """ Sets the the proportion of total assets in a project to review.
11991171
0 commit comments