Skip to content

Commit 2f74631

Browse files
authored
adds check for no values (#36)
1 parent c6cc86c commit 2f74631

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

controller/integration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def fit_predict(
6969
)
7070

7171
task_type, df = collect_data(project_id, labeling_task_id, True)
72+
if len(df.index) == 0:
73+
#nothing to calculate no values are present (e.g. source run through but didn't hit anything)
74+
return
7275
try:
7376
if task_type == enums.LabelingTaskType.CLASSIFICATION.value:
7477
results = integrate_classification(df, quality_metrics_overwrite)

controller/stats.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def calculate_quantity_statistics_for_labeling_task_from_source(
146146
_, df = integration.collect_data(
147147
labeling_task_item.project_id, labeling_task_item.id, False
148148
)
149+
if len(df.index) == 0:
150+
#nothing to calculate if the source didn't hit anything
151+
return
149152
if labeling_task_item.task_type == enums.LabelingTaskType.CLASSIFICATION.value:
150153
statistics = classification_quantity(df)
151154
else:

0 commit comments

Comments
 (0)