Skip to content

Commit db550b6

Browse files
JWittmeyerJWittmeyerlumburovskalina
authored
release updates (#114)
* Adds new notificaiton type * Checks for NONE tasks * Submodules change --------- Co-authored-by: JWittmeyer <[email protected]> Co-authored-by: Lina <[email protected]>
1 parent 5826b56 commit db550b6

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

controller/notification/notification_data.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@
179179
"page": enums.Pages.INFORMATION_SOURCES.value,
180180
"docs": enums.DOCS.WEAK_SUPERVISION.value,
181181
},
182+
enums.NotificationType.WEAK_SUPERVISION_TASK_NO_VALID_LABELS.value: {
183+
"message_template": "Can't start weak supervision without valid est. precision.",
184+
"title": "Weak supervision",
185+
"level": enums.Notification.WARNING.value,
186+
"page": enums.Pages.INFORMATION_SOURCES.value,
187+
"docs": enums.DOCS.WEAK_SUPERVISION.value,
188+
},
182189
enums.NotificationType.IMPORT_SAMPLE_PROJECT.value: {
183190
"message_template": "Copying sample project into workspace.",
184191
"title": "Sample project",

controller/transfer/record_export_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ def __extract_table_meta_classification_data(
127127
tables_mapping = {}
128128
tables_meta_data = {}
129129
for task_id in selected_tasks:
130+
if task_id == "NONE_IN_PROJECT":
131+
break
130132
task = tasks_by_id.get(task_id)
131133

132134
if task.task_type == enums.LabelingTaskType.INFORMATION_EXTRACTION.value:

graphql_api/mutation/weak_supervisor.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def mutate(
146146
"Weak Supervision Task",
147147
)
148148
notification.send_organization_update(
149-
project_id, f"weak_supervision_started"
149+
project_id, "weak_supervision_started"
150150
)
151151

152152
weak_supervision_task = ws_manager.create_task(
@@ -175,7 +175,7 @@ def mutate(
175175
"Weak Supervision Task",
176176
)
177177
notification.send_organization_update(
178-
project_id, f"weak_supervision_finished"
178+
project_id, "weak_supervision_finished"
179179
)
180180
except Exception as e:
181181
print(traceback.format_exc(), flush=True)
@@ -187,19 +187,16 @@ def mutate(
187187
with_commit=True,
188188
)
189189
notification.send_organization_update(
190-
project_id, f"weak_supervision_finished"
190+
project_id, "weak_supervision_failed"
191191
)
192192
raise e
193193
else:
194194
create_notification(
195-
NotificationType.WEAK_SUPERVISION_TASK_FAILED,
195+
NotificationType.WEAK_SUPERVISION_TASK_NO_VALID_LABELS,
196196
user.id,
197197
project_id,
198-
"Weak Supervision Task",
199-
)
200-
notification.send_organization_update(
201-
project_id, f"weak_supervision_failed"
202198
)
199+
notification.send_organization_update(project_id, "weak_supervision_failed")
203200
return RunInformationSourceAndInitiateWeakSupervisionByLabelingTaskId(ok=True)
204201

205202

submodules/model

Submodule model updated 1 file

0 commit comments

Comments
 (0)