Skip to content

Commit af86bc4

Browse files
authored
[QQC-3241] Remove project.upsert_review_queue() in SDK (#1406)
2 parents e10c922 + 4575dcb commit af86bc4

File tree

2 files changed

+8
-51
lines changed

2 files changed

+8
-51
lines changed

labelbox/schema/project.py

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ def export_v2(
490490
Creates a project export task with the given params and returns the task.
491491
492492
For more information visit: https://docs.labelbox.com/docs/exports-v2#export-from-a-project-python-sdk
493-
493+
494494
>>> task = project.export_v2(
495495
>>> filters={
496496
>>> "last_activity_at": ["2000-01-01 00:00:00", "2050-01-01 00:00:00"],
497497
>>> "label_created_at": ["2000-01-01 00:00:00", "2050-01-01 00:00:00"],
498-
>>> "data_row_ids": [DATA_ROW_ID_1, DATA_ROW_ID_2, ...] # or global_keys: [DATA_ROW_GLOBAL_KEY_1, DATA_ROW_GLOBAL_KEY_2, ...]
498+
>>> "data_row_ids": [DATA_ROW_ID_1, DATA_ROW_ID_2, ...] # or global_keys: [DATA_ROW_GLOBAL_KEY_1, DATA_ROW_GLOBAL_KEY_2, ...]
499499
>>> "batch_ids": [BATCH_ID_1, BATCH_ID_2, ...]
500500
>>> },
501501
>>> params={
@@ -800,8 +800,8 @@ def create_batch(
800800
801801
Args:
802802
name: a name for the batch, must be unique within a project
803-
data_rows: Either a list of `DataRows` or Data Row ids.
804-
global_keys: global keys for data rows to add to the batch.
803+
data_rows: Either a list of `DataRows` or Data Row ids.
804+
global_keys: global keys for data rows to add to the batch.
805805
priority: An optional priority for the Data Rows in the Batch. 1 highest -> 5 lowest
806806
consensus_settings: An optional dictionary with consensus settings: {'number_of_labels': 3,
807807
'coverage_percentage': 0.1}
@@ -1238,7 +1238,7 @@ def set_labeling_parameter_overrides(
12381238
"""mutation SetLabelingParameterOverridesPyApi($$projectId: ID!)
12391239
{project(where: { id: $$projectId })
12401240
{setLabelingParameterOverrides
1241-
(dataWithDataRowIdentifiers: [$dataWithDataRowIdentifiers])
1241+
(dataWithDataRowIdentifiers: [$dataWithDataRowIdentifiers])
12421242
{success}}}
12431243
""")
12441244

@@ -1288,7 +1288,7 @@ def update_data_row_labeling_priority(
12881288
https://docs.labelbox.com/en/configure-editor/queue-system#reservation-system
12891289
12901290
Args:
1291-
data_rows: a list of data row ids to update priorities for. This can be a list of strings or a DataRowIdentifiers object
1291+
data_rows: a list of data row ids to update priorities for. This can be a list of strings or a DataRowIdentifiers object
12921292
DataRowIdentifier objects are lists of ids or global keys. A DataIdentifier object can be a UniqueIds or GlobalKeys class.
12931293
priority (int): Priority for the new override. See above for more information.
12941294
@@ -1338,37 +1338,6 @@ def update_data_row_labeling_priority(
13381338
json.dumps(task.errors))
13391339
return True
13401340

1341-
def upsert_review_queue(self, quota_factor) -> None:
1342-
""" Sets the proportion of total assets in a project to review.
1343-
1344-
Deprecation notice: This method is deprecated and will be removed in a future version. The review step was
1345-
replaced by Workflows in order to offer more flexibility in customizing the review flow for labeling tasks.
1346-
Read more on Workflows here: https://docs.labelbox.com/docs/workflows
1347-
1348-
More information can be found here:
1349-
https://docs.labelbox.com/en/quality-assurance/review-labels#configure-review-percentage
1350-
1351-
Args:
1352-
quota_factor (float): Which part (percentage) of the queue
1353-
to reinitiate. Between 0 and 1.
1354-
"""
1355-
1356-
logger.warning("Updating the review queue is no longer supported.")
1357-
1358-
if not 0. <= quota_factor <= 1.:
1359-
raise ValueError("Quota factor must be in the range of [0,1]")
1360-
1361-
id_param = "projectId"
1362-
quota_param = "quotaFactor"
1363-
query_str = """mutation UpsertReviewQueuePyApi($%s: ID!, $%s: Float!){
1364-
upsertReviewQueue(where:{project: {id: $%s}}
1365-
data:{quotaFactor: $%s}) {id}}""" % (
1366-
id_param, quota_param, id_param, quota_param)
1367-
res = self.client.execute(query_str, {
1368-
id_param: self.uid,
1369-
quota_param: quota_factor
1370-
})
1371-
13721341
def extend_reservations(self, queue_type) -> int:
13731342
""" Extends all the current reservations for the current user on the given
13741343
queue type.
@@ -1492,7 +1461,7 @@ def move_data_rows_to_task_queue(self, data_row_ids, task_queue_id: str):
14921461
Moves data rows to the specified task queue.
14931462
14941463
Args:
1495-
data_row_ids: a list of data row ids to be moved. This can be a list of strings or a DataRowIdentifiers object
1464+
data_row_ids: a list of data row ids to be moved. This can be a list of strings or a DataRowIdentifiers object
14961465
DataRowIdentifier objects are lists of ids or global keys. A DataIdentifier object can be a UniqueIds or GlobalKeys class.
14971466
task_queue_id: the task queue id to be moved to, or None to specify the "Done" queue
14981467
@@ -1647,7 +1616,7 @@ def _poll_data_row_processing_status(
16471616
if (datetime.now() -
16481617
start_time).total_seconds() >= wait_processing_max_seconds:
16491618
raise ProcessingWaitTimeout(
1650-
"""Maximum wait time exceeded while waiting for data rows to be processed.
1619+
"""Maximum wait time exceeded while waiting for data rows to be processed.
16511620
Try creating a batch a bit later""")
16521621

16531622
all_good = self.__check_data_rows_have_been_processed(

tests/integration/test_project.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,6 @@ def test_project_filtering(client, rand_gen, data_for_project_test):
129129
assert list(client.get_projects(where=Project.name == name_2)) == [p2]
130130

131131

132-
def test_upsert_review_queue(project):
133-
project.upsert_review_queue(0.6)
134-
135-
with pytest.raises(ValueError) as exc_info:
136-
project.upsert_review_queue(1.001)
137-
assert str(exc_info.value) == "Quota factor must be in the range of [0,1]"
138-
139-
with pytest.raises(ValueError) as exc_info:
140-
project.upsert_review_queue(-0.001)
141-
assert str(exc_info.value) == "Quota factor must be in the range of [0,1]"
142-
143-
144132
def test_extend_reservations(project):
145133
assert project.extend_reservations("LabelingQueue") == 0
146134
assert project.extend_reservations("ReviewQueue") == 0

0 commit comments

Comments
 (0)