refactor(chalice): throw an error when endTimestamp is 0 for product analytics

This commit is contained in:
Taha Yassine Kraiem 2025-03-05 13:12:34 +01:00 committed by Kraiem Taha Yassine
parent 46e6f1a503
commit 366d2e1017

View file

@ -2,6 +2,8 @@ from typing import List
def get_step_size(startTimestamp, endTimestamp, density, decimal=False, factor=1000):
if endTimestamp == 0:
raise Exception("endTimestamp cannot be 0 in order to get step size")
step_size = (endTimestamp // factor - startTimestamp // factor)
if density <= 1:
return step_size