Closed
Description
If you call list_events
with a float, no client-side validation rejects this, but the API server doesn't handle floats, and the request fails.
To Reproduce
Steps to reproduce the behavior:
- Do
list_events(1, 1)
. This works (returns an empty list generally). - Do
list_events(1.0, 1.0)
. This fails with an obscure error:
HTTP response body: {"errors": ["The value provided for parameter 'start' is invalid"]}
Expected behavior
Either this library should coerce to int (dropping the fractional part) or raise some sort of validation error before sending the request.
Environment and Versions (please complete the following information):
$ pip list | grep datadog
datadog-api-client 1.0.0b6
Additional context
datetime.timestamp()
returns a float, which is how I was trying to use this method.
Also the documentation examples could be better. They specify the ints 1
and 1
for both start and end, a thing that would never happen. Suggest showing something relative to datetime.utcnow()
.