4n4nd / prometheus-api-client-python

A python wrapper for the prometheus http api
MIT License
234 stars 77 forks source link

Issue with dateparser #29

Closed 4n4nd closed 5 years ago

4n4nd commented 5 years ago

https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/metric.py#L146-L148 Here, sometimes the dateparser parses date in a yyyy-dd-mm format which is incorrect. We can add settings={"DATE_ORDER": "YMD"} to fix this issue. While at it, we should make this change in every place dateparser.parse is used

4n4nd commented 5 years ago

https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/prometheus_connect.py#L153-L154

4n4nd commented 5 years ago

https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/prometheus_connect.py#L160-L161

4n4nd commented 5 years ago

https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/prometheus_connect.py#L237

4n4nd commented 5 years ago

Maybe we can add some unit tests for this

4n4nd commented 5 years ago

More details on this bug https://github.com/scrapinghub/dateparser/issues/549