Skip to content

Commit 9e3a0c8

Browse files
[PLT-1135] Alias these commands to each other so users don't have to remember which one is valid.
1 parent 4b17a95 commit 9e3a0c8

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

libs/labelbox/src/labelbox/schema/annotation_import.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ def statuses(self) -> List[Dict[str, Any]]:
9292
self.wait_until_done()
9393
return self._fetch_remote_ndjson(self.status_file_url)
9494

95+
def wait_till_done(self,
96+
sleep_time_seconds: int = 10,
97+
show_progress: bool = False) -> None:
98+
self.wait_until_done(sleep_time_seconds, show_progress)
99+
95100
def wait_until_done(self,
96101
sleep_time_seconds: int = 10,
97102
show_progress: bool = False) -> None:

libs/labelbox/src/labelbox/schema/bulk_import_request.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def refresh(self) -> None:
181181
res = res[utils.camel_case(BulkImportRequest.type_name())]
182182
self._set_field_values(res)
183183

184+
def wait_till_done(self, sleep_time_seconds: int = 5) -> None:
185+
self.wait_until_done(sleep_time_seconds)
186+
184187
def wait_until_done(self, sleep_time_seconds: int = 5) -> None:
185188
"""Blocks import job until certain conditions are met.
186189

libs/labelbox/src/labelbox/schema/create_batches_task.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def __init__(self, client, project_id: str, batch_ids: List[str],
2323
Entity.Task.get_task(self.client, task_id) for task_id in task_ids
2424
]
2525

26+
def wait_until_done(self, timeout_seconds: int = 300) -> None:
27+
self.wait_till_done(timeout_seconds)
28+
2629
def wait_till_done(self, timeout_seconds: int = 300) -> None:
2730
"""
2831
Waits for the task to complete.

libs/labelbox/src/labelbox/schema/export_task.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,9 @@ def organization(self):
788788
"""Returns the organization of the task."""
789789
return self._task.organization
790790

791+
def wait_until_done(self, timeout_seconds: int = 7200) -> None:
792+
self.wait_till_done(timeout_seconds)
793+
791794
def wait_till_done(self, timeout_seconds: int = 7200) -> None:
792795
"""Waits until the task is done."""
793796
return self._task.wait_till_done(timeout_seconds)

libs/labelbox/src/labelbox/schema/task.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def has_errors(self) -> bool:
8484
return bool(self.failed_data_rows)
8585
return self.status == "FAILED"
8686

87+
def wait_until_done(self,
88+
timeout_seconds: float = 300.0,
89+
check_frequency: float = 2.0) -> None:
90+
self.wait_till_done(timeout_seconds, check_frequency)
91+
8792
def wait_till_done(self,
8893
timeout_seconds: float = 300.0,
8994
check_frequency: float = 2.0) -> None:

0 commit comments

Comments
 (0)