Skip to content

Commit 54f8cb0

Browse files
fix(seer): Ensure count is a valid float in TimeSeriesPoint
1 parent 6ee8140 commit 54f8cb0

File tree

1 file changed

+2
-1
lines changed
  • src/sentry/seer/anomaly_detection

1 file changed

+2
-1
lines changed

src/sentry/seer/anomaly_detection/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ def format_crash_free_data(data: SnubaTSResult) -> list[TimeSeriesPoint]:
157157

158158
for time, count in zip(nested_data.get("intervals"), series.get("sum(session)", 0)):
159159
date = datetime.strptime(time, "%Y-%m-%dT%H:%M:%SZ")
160-
ts_point = TimeSeriesPoint(timestamp=date.timestamp(), value=count)
160+
count_value = 0.0 if count is None else float(count)
161+
ts_point = TimeSeriesPoint(timestamp=date.timestamp(), value=count_value)
161162
formatted_data.append(ts_point)
162163
return formatted_data
163164

0 commit comments

Comments
 (0)