refactor(chalice): throw an error when endTimestamp is 0 for product analytics
This commit is contained in:
parent
46e6f1a503
commit
366d2e1017
1 changed files with 2 additions and 0 deletions
|
|
@ -2,6 +2,8 @@ from typing import List
|
||||||
|
|
||||||
|
|
||||||
def get_step_size(startTimestamp, endTimestamp, density, decimal=False, factor=1000):
|
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)
|
step_size = (endTimestamp // factor - startTimestamp // factor)
|
||||||
if density <= 1:
|
if density <= 1:
|
||||||
return step_size
|
return step_size
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue