From 40ecc26a08875e2a4a50b743b0e65983fb6ec858 Mon Sep 17 00:00:00 2001 From: Val Brodsky Date: Mon, 26 Aug 2024 11:09:28 -0700 Subject: [PATCH 1/2] Rename Project labeling_service_dashboard() to get_labeling_service_dashboard() --- libs/labelbox/src/labelbox/schema/project.py | 2 +- libs/labelbox/tests/integration/test_labeling_dashboard.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/labelbox/src/labelbox/schema/project.py b/libs/labelbox/src/labelbox/schema/project.py index ff093567c..3856f0a46 100644 --- a/libs/labelbox/src/labelbox/schema/project.py +++ b/libs/labelbox/src/labelbox/schema/project.py @@ -1943,7 +1943,7 @@ def get_labeling_service_status(self) -> LabelingServiceStatus: return self.get_labeling_service().status @experimental - def labeling_service_dashboard(self) -> LabelingServiceDashboard: + def get_labeling_service_dashboard(self) -> LabelingServiceDashboard: """Get the labeling service for this project. Returns: diff --git a/libs/labelbox/tests/integration/test_labeling_dashboard.py b/libs/labelbox/tests/integration/test_labeling_dashboard.py index 803293497..492454965 100644 --- a/libs/labelbox/tests/integration/test_labeling_dashboard.py +++ b/libs/labelbox/tests/integration/test_labeling_dashboard.py @@ -9,7 +9,7 @@ def test_request_labeling_service_dashboard(requested_labeling_service): project, _ = requested_labeling_service - labeling_service_dashboard = project.labeling_service_dashboard() + labeling_service_dashboard = project.get_labeling_service_dashboard() assert labeling_service_dashboard.status == LabelingServiceStatus.Requested assert labeling_service_dashboard.tasks_completed == 0 assert labeling_service_dashboard.tasks_remaining == 0 From 1f8f94f11abc0148dc4506b278888e917cd1af5b Mon Sep 17 00:00:00 2001 From: Val Brodsky Date: Mon, 26 Aug 2024 12:07:06 -0700 Subject: [PATCH 2/2] Updated documentation for search filters --- libs/labelbox/src/labelbox/schema/project.py | 20 ++++++++++++++++++- .../src/labelbox/schema/search_filters.py | 11 ++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/libs/labelbox/src/labelbox/schema/project.py b/libs/labelbox/src/labelbox/schema/project.py index 3856f0a46..0993ff048 100644 --- a/libs/labelbox/src/labelbox/schema/project.py +++ b/libs/labelbox/src/labelbox/schema/project.py @@ -1947,7 +1947,25 @@ def get_labeling_service_dashboard(self) -> LabelingServiceDashboard: """Get the labeling service for this project. Returns: - LabelingService: The labeling service for this project. + LabelingServiceDashboard: The labeling service for this project. + + Attributes of the dashboard include: + id (str): The project id. + name (str): The project name. + created_at, updated_at (datetime): The creation and last update times of the labeling service. None if labeling service is not requested. + created_by_id (str): The user id of the creator of the labeling service. None if labeling service is not requested. + status (LabelingServiceStatus): The status of the labeling service. Returns LabelingServiceStatus.Missing if labeling service is not requested. + data_rows_count (int): The number of data rows in the project. 0 if labeling service is not requested. + data_rows_in_review_count (int): The number of data rows in review queue. 0 if labeling service is not requested. + data_rows_in_rework_count (int): The number of data rows in rework. 0 if labeling service is not requested. + data_rows_done_count (int): The number of data rows in done queue. 0 if labeling service is not requested. + tags (List[str]): Project tags. + tasks_completed (int): The number of tasks completed, the same as data_rows_done_count. 0 if labeling service is not requested. + tasks_remaining (int): The number of tasks remaining, the same as data_rows_count - data_rows_done_count. 0 if labeling service is not requested. + service_type (str): Descriptive type for labeling service. + + NOTE can call dict() to get all attributes as dictionary. + """ return LabelingServiceDashboard.get(self.client, self.uid) diff --git a/libs/labelbox/src/labelbox/schema/search_filters.py b/libs/labelbox/src/labelbox/schema/search_filters.py index 10b46755d..00ed680f9 100644 --- a/libs/labelbox/src/labelbox/schema/search_filters.py +++ b/libs/labelbox/src/labelbox/schema/search_filters.py @@ -30,6 +30,7 @@ def dict(self, *args, **kwargs): class OperationType(Enum): """ Supported search entity types + Each type corresponds to a different filter class """ Organization = 'organization_id' SharedWithOrganization = 'shared_with_organizations' @@ -44,7 +45,7 @@ class OperationType(Enum): class IdOperator(Enum): """ - Supported operators for ids + Supported operators for ids like org ids, workspace ids, etc """ Is = 'is' @@ -67,7 +68,7 @@ class RangeOperatorWithValue(Enum): class OrganizationFilter(BaseSearchFilter): """ - Filter for organization + Filter for organization to which projects belong """ operation: Literal[OperationType.Organization] = OperationType.Organization operator: IdOperator @@ -76,7 +77,7 @@ class OrganizationFilter(BaseSearchFilter): class SharedWithOrganizationFilter(BaseSearchFilter): """ - Find project shared with organization (i.e. not belonging to any of organization's workspace) + Find project shared with the organization (i.e. not having this organization as a tenantId) """ operation: Literal[ OperationType. @@ -106,6 +107,7 @@ class TagFilter(BaseSearchFilter): class ProjectStageFilter(BaseSearchFilter): """ Filter labelbox service / aka project stages + Stages are: requested, in_progress, completed etc. as described by LabelingServiceStatus """ operation: Literal[OperationType.Stage] = OperationType.Stage operator: IdOperator @@ -192,6 +194,7 @@ class WorkforceStageUpdatedRangeFilter(BaseSearchFilter): class TaskCompletedCountFilter(BaseSearchFilter): """ Filter for completed tasks count + A task maps to a data row. Task completed should map to a data row in a labeling queue DONE """ operation: Literal[ OperationType.TaskCompletedCount] = OperationType.TaskCompletedCount @@ -200,7 +203,7 @@ class TaskCompletedCountFilter(BaseSearchFilter): class TaskRemainingCountFilter(BaseSearchFilter): """ - Filter for remaining tasks count + Filter for remaining tasks count. Reverse of TaskCompletedCountFilter """ operation: Literal[ OperationType.TaskRemainingCount] = OperationType.TaskRemainingCount