13
13
GRAPHQL_QUERY_SELECTIONS = """
14
14
id
15
15
name
16
- # serviceType
17
- # createdAt
18
- # updatedAt
19
- # createdById
16
+ boostRequestedAt
17
+ boostUpdatedAt
18
+ boostRequestedBy
20
19
boostStatus
21
20
dataRowsCount
22
21
dataRowsInReviewCount
@@ -44,15 +43,13 @@ class LabelingServiceDashboard(BaseModel):
44
43
created_at : Optional [datetime ] = Field (frozen = True , default = None )
45
44
updated_at : Optional [datetime ] = Field (frozen = True , default = None )
46
45
created_by_id : Optional [str ] = Field (frozen = True , default = None )
47
- status : LabelingServiceStatus = Field (frozen = True ,
48
- default = LabelingServiceStatus .Missing )
46
+ status : LabelingServiceStatus = Field (frozen = True , default = None )
49
47
data_rows_count : int = Field (frozen = True )
50
48
data_rows_in_review_count : int = Field (frozen = True )
51
49
data_rows_in_rework_count : int = Field (frozen = True )
52
50
data_rows_done_count : int = Field (frozen = True )
53
- media_type : MediaType = Field (frozen = True , default = MediaType .Unknown )
54
- editor_task_type : EditorTaskType = Field (frozen = True ,
55
- default = EditorTaskType .Missing )
51
+ media_type : Optional [MediaType ] = Field (frozen = True , default = None )
52
+ editor_task_type : EditorTaskType = Field (frozen = True , default = None )
56
53
57
54
client : Any # type Any to avoid circular import from client
58
55
@@ -72,6 +69,9 @@ def tasks_remaining(self):
72
69
73
70
@property
74
71
def service_type (self ):
72
+ if self .media_type is None :
73
+ return None
74
+
75
75
if self .editor_task_type is None :
76
76
return sentence_case (self .media_type .value )
77
77
@@ -84,7 +84,7 @@ def service_type(self):
84
84
if self .editor_task_type == EditorTaskType .ResponseCreation and self .media_type == MediaType .Text :
85
85
return "Response creation"
86
86
87
- if media_type == MediaType .LLMPromptCreation or media_type == MediaType .LLMPromptResponseCreation :
87
+ if self . media_type == MediaType .LLMPromptCreation or self . media_type == MediaType .LLMPromptResponseCreation :
88
88
return "Prompt response creation"
89
89
90
90
return sentence_case (self .media_type .value )
@@ -157,8 +157,17 @@ def convert_to_labeling_service_dashboard(client, data):
157
157
)
158
158
159
159
@root_validator (pre = True )
160
- def convert_boost_status_to_enum (cls , data ):
160
+ def convert_boost_data (cls , data ):
161
161
if 'boostStatus' in data :
162
162
data ['status' ] = LabelingServiceStatus (data .pop ('boostStatus' ))
163
163
164
+ if 'boostRequestedAt' in data :
165
+ data ['created_at' ] = data .pop ('boostRequestedAt' )
166
+
167
+ if 'boostUpdatedAt' in data :
168
+ data ['updated_at' ] = data .pop ('boostUpdatedAt' )
169
+
170
+ if 'boostRequestedBy' in data :
171
+ data ['created_by_id' ] = data .pop ('boostRequestedBy' )
172
+
164
173
return data
0 commit comments