Skip to content

Commit

Permalink
improve error message on _verify_time_range to include user given (no…
Browse files Browse the repository at this point in the history
…t just converted ms)
  • Loading branch information
haakonvt committed May 28, 2024
1 parent 9c768f8 commit dc1c766
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cognite/client/_api/datapoint_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ def _verify_time_range(
end = _FullDatapointsQuery._ts_to_ms_frozen_now(query.end, frozen_time_now, default=frozen_time_now)
if end <= start:
raise ValueError(
f"Invalid time range, {end=} ({query.end}) must be later than {start=} ({query.start})"
f"Invalid time range, {end=} {f'({query.end!r}) ' if end != query.end else ''}"
f"must be later than {start=} {f'({query.start!r}) ' if start != query.start else ''}"
f"(from query: {query.identifier.as_dict(camel_case=False)})"
)
# We align start and end so that we can efficiently parallelize aggregate dps fetching. Queries
Expand Down

0 comments on commit dc1c766

Please sign in to comment.