@@ -1127,10 +1127,6 @@ def validate_labeling_parameter_overrides(self, data) -> None:
1127
1127
raise TypeError (
1128
1128
f"Priority must be an int. Found { type (priority )} for data_row { data_row } . Index: { idx } "
1129
1129
)
1130
- if priority < 1 :
1131
- raise ValueError (
1132
- f"Priority must be greater than 0 for data_row { data_row } . Index: { idx } "
1133
- )
1134
1130
1135
1131
def set_labeling_parameter_overrides (self , data ) -> bool :
1136
1132
""" Adds labeling parameter overrides to this project.
@@ -1143,26 +1139,21 @@ def set_labeling_parameter_overrides(self, data) -> bool:
1143
1139
1144
1140
Args:
1145
1141
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.
1147
1143
1148
1144
Priority:
1149
1145
* Data will be labeled in priority order.
1150
1146
- A lower number priority is labeled first.
1151
- - Minimum priority is 1 .
1147
+ - All signed 32-bit integers are accepted, from -2147483648 to 2147483647 .
1152
1148
* Priority is not the queue position.
1153
1149
- The position is determined by the relative priority.
1154
1150
- E.g. [(data_row_1, 5,1), (data_row_2, 2,1), (data_row_3, 10,1)]
1155
1151
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.
1157
1152
* The priority only effects items in the queue.
1158
1153
- Assigning a priority will not automatically add the item back into the queue.
1159
1154
Returns:
1160
1155
bool, indicates if the operation was a success.
1161
1156
"""
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
- )
1166
1157
data = [t [:2 ] for t in data ]
1167
1158
self .validate_labeling_parameter_overrides (data )
1168
1159
data_str = ",\n " .join ("{dataRow: {id: \" %s\" }, priority: %d }" %
@@ -1175,25 +1166,6 @@ def set_labeling_parameter_overrides(self, data) -> bool:
1175
1166
res = self .client .execute (query_str , {id_param : self .uid })
1176
1167
return res ["project" ]["setLabelingParameterOverrides" ]["success" ]
1177
1168
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
-
1197
1169
def upsert_review_queue (self , quota_factor ) -> None :
1198
1170
""" Sets the the proportion of total assets in a project to review.
1199
1171
0 commit comments