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