Skip to content

[PLT-1135] Alias these commands to each other so users don't have to remember which one is valid. #1675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libs/labelbox/src/labelbox/schema/annotation_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def statuses(self) -> List[Dict[str, Any]]:
self.wait_until_done()
return self._fetch_remote_ndjson(self.status_file_url)

def wait_till_done(self,
sleep_time_seconds: int = 10,
show_progress: bool = False) -> None:
self.wait_until_done(sleep_time_seconds, show_progress)

def wait_until_done(self,
sleep_time_seconds: int = 10,
show_progress: bool = False) -> None:
Expand Down
3 changes: 3 additions & 0 deletions libs/labelbox/src/labelbox/schema/bulk_import_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def refresh(self) -> None:
res = res[utils.camel_case(BulkImportRequest.type_name())]
self._set_field_values(res)

def wait_till_done(self, sleep_time_seconds: int = 5) -> None:
self.wait_until_done(sleep_time_seconds)

def wait_until_done(self, sleep_time_seconds: int = 5) -> None:
"""Blocks import job until certain conditions are met.

Expand Down
3 changes: 3 additions & 0 deletions libs/labelbox/src/labelbox/schema/create_batches_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def __init__(self, client, project_id: str, batch_ids: List[str],
Entity.Task.get_task(self.client, task_id) for task_id in task_ids
]

def wait_until_done(self, timeout_seconds: int = 300) -> None:
self.wait_till_done(timeout_seconds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might consider writing a unit tests (e.g.) copy and paste to ensure if they are changed accidentally, nothing breaks


def wait_till_done(self, timeout_seconds: int = 300) -> None:
"""
Waits for the task to complete.
Expand Down
3 changes: 3 additions & 0 deletions libs/labelbox/src/labelbox/schema/export_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,9 @@ def organization(self):
"""Returns the organization of the task."""
return self._task.organization

def wait_until_done(self, timeout_seconds: int = 7200) -> None:
self.wait_till_done(timeout_seconds)

def wait_till_done(self, timeout_seconds: int = 7200) -> None:
"""Waits until the task is done."""
return self._task.wait_till_done(timeout_seconds)
Expand Down
5 changes: 5 additions & 0 deletions libs/labelbox/src/labelbox/schema/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def has_errors(self) -> bool:
return bool(self.failed_data_rows)
return self.status == "FAILED"

def wait_until_done(self,
timeout_seconds: float = 300.0,
check_frequency: float = 2.0) -> None:
self.wait_till_done(timeout_seconds, check_frequency)

def wait_till_done(self,
timeout_seconds: float = 300.0,
check_frequency: float = 2.0) -> None:
Expand Down
Loading