diff --git a/libs/labelbox/src/labelbox/schema/project.py b/libs/labelbox/src/labelbox/schema/project.py index ff093567c..0993ff048 100644 --- a/libs/labelbox/src/labelbox/schema/project.py +++ b/libs/labelbox/src/labelbox/schema/project.py @@ -1943,11 +1943,29 @@ 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: - 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 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