Skip to content

Commit b497afb

Browse files
author
Val Brodsky
committed
Add model_setup_complete to Project
1 parent 555ce57 commit b497afb

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

libs/labelbox/src/labelbox/schema/project.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313

1414
from labelbox import parser
1515
from labelbox import utils
16-
from labelbox.exceptions import (
17-
InvalidQueryError,
18-
LabelboxError,
19-
ProcessingWaitTimeout,
20-
ResourceConflict,
21-
ResourceNotFoundError
22-
)
16+
from labelbox.exceptions import (InvalidQueryError, LabelboxError,
17+
ProcessingWaitTimeout, ResourceConflict,
18+
ResourceNotFoundError)
2319
from labelbox.orm import query
2420
from labelbox.orm.db_object import DbObject, Deletable, Updateable, experimental
2521
from labelbox.orm.model import Entity, Field, Relationship
@@ -121,7 +117,11 @@ class Project(DbObject, Updateable, Deletable):
121117
# Bind data_type and allowedMediaTYpe using the GraphQL type MediaType
122118
media_type = Field.Enum(MediaType, "media_type", "allowedMediaType")
123119
editor_task_type = Field.Enum(EditorTaskType, "editor_task_type")
120+
<<<<<<< HEAD
124121
data_row_count = Field.Int("data_row_count")
122+
=======
123+
model_setup_complete = Field.Boolean("model_setup_complete")
124+
>>>>>>> 8d9b99f7 (Add model_setup_complete to Project)
125125

126126
# Relationships
127127
created_by = Relationship.ToOne("User", False, "created_by")
@@ -1752,7 +1752,9 @@ def __check_data_rows_have_been_processed(
17521752
return response["queryAllDataRowsHaveBeenProcessed"][
17531753
"allDataRowsHaveBeenProcessed"]
17541754

1755-
def get_overview(self, details=False) -> Union[ProjectOverview, ProjectOverviewDetailed]:
1755+
def get_overview(
1756+
self,
1757+
details=False) -> Union[ProjectOverview, ProjectOverviewDetailed]:
17561758
"""Return the overview of a project.
17571759
17581760
This method returns the number of data rows per task queue and issues of a project,
@@ -1792,7 +1794,7 @@ def get_overview(self, details=False) -> Union[ProjectOverview, ProjectOverviewD
17921794

17931795
# Must use experimental to access "issues"
17941796
result = self.client.execute(query, {"projectId": self.uid},
1795-
experimental=True)["project"]
1797+
experimental=True)["project"]
17961798

17971799
# Reformat category names
17981800
overview = {
@@ -1805,26 +1807,28 @@ def get_overview(self, details=False) -> Union[ProjectOverview, ProjectOverviewD
18051807

18061808
# Rename categories
18071809
overview["to_label"] = overview.pop("unlabeled")
1808-
overview["total_data_rows"] = overview.pop("all")
1810+
overview["total_data_rows"] = overview.pop("all")
18091811

18101812
if not details:
18111813
return ProjectOverview(**overview)
18121814
else:
18131815
# Build dictionary for queue details for review and rework queues
18141816
for category in ["rework", "review"]:
18151817
queues = [
1816-
{tq["name"]: tq.get("dataRowCount")}
1818+
{
1819+
tq["name"]: tq.get("dataRowCount")
1820+
}
18171821
for tq in result.get("taskQueues")
18181822
if tq.get("queueType") == f"MANUAL_{category.upper()}_QUEUE"
18191823
]
18201824

1821-
overview[f"in_{category}"] = {
1825+
overview[f"in_{category}"] = {
18221826
"data": queues,
18231827
"total": overview[f"in_{category}"]
18241828
}
1825-
1829+
18261830
return ProjectOverviewDetailed(**overview)
1827-
1831+
18281832
def clone(self) -> "Project":
18291833
"""
18301834
Clones the current project.

libs/labelbox/tests/integration/test_chat_evaluation_ontology_project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def test_create_chat_evaluation_ontology_project(
2424
assert classification.feature_schema_id
2525

2626
project = chat_evaluation_project_create_dataset
27+
assert project.model_setup_complete is None
28+
2729
project.setup_editor(ontology)
2830

2931
assert project.labeling_frontend().name == "Editor"

0 commit comments

Comments
 (0)