Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/polar/event/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ async def list_statistics_timeseries(
{
"loc": ("query",),
"msg": (
"The interval is too big. "
"Try to change the interval or reduce the date range."
"The interval does not match the date range. "
"Try to change the interval or adjust the date range."
),
"type": "value_error",
"input": (start_date, end_date, interval),
Expand Down
3 changes: 2 additions & 1 deletion server/polar/kit/time_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ def get_timestamp_series_cte(


def is_under_limits(start_date: date, end_date: date, interval: TimeInterval) -> bool:
return end_date.toordinal() - start_date.toordinal() <= MAX_INTERVAL_DAYS[interval]
days = end_date.toordinal() - start_date.toordinal()
return days >= MIN_INTERVAL_DAYS[interval] and days <= MAX_INTERVAL_DAYS[interval]
4 changes: 2 additions & 2 deletions server/polar/meter/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ async def quantities(
{
"loc": ("query",),
"msg": (
"The interval is too big. "
"Try to change the interval or reduce the date range."
"The interval does not match the date range. "
"Try to change the interval or adjust the date range."
),
"type": "value_error",
"input": (start_timestamp, end_timestamp, interval),
Expand Down
4 changes: 2 additions & 2 deletions server/polar/metrics/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ async def get(
{
"loc": ("query",),
"msg": (
"The interval is too big. "
"Try to change the interval or reduce the date range."
"The interval does not match the date range. "
"Try to change the interval or adjust the date range."
),
"type": "value_error",
"input": (start_date, end_date, interval),
Expand Down
Loading