Skip to content

Commit 853b218

Browse files
committed
[API] Fix uncatched error in training
1 parent 8747fb7 commit 853b218

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

api/anomaly_detection/predictions/tasks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def refresh_prediction_task(metric_id, refresh_progress=True):
3939
metric.save(update_fields=['predictor'])
4040

4141
results = metric.predictor.predict(dates=[metric.date,])
42+
if not results:
43+
return
4244
try:
4345
if result := results[0]:
4446
metric.predicted_value = result['yhat']

api/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ geopandas>=1.0.1,<1.1
2020
prophet>=1.1.6,<1.2
2121
celery>=5.5.2,<5.6
2222
flower>=2.0.1,<2.1
23-
tqdm>=4.67.1,<4.68
23+
tqdm>=4.67.1,<4.68
24+
ipython>=9.3.0,<9.4.0

0 commit comments

Comments
 (0)