Closed 4n4nd closed 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
settings={"DATE_ORDER": "YMD"}
https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/prometheus_connect.py#L153-L154
https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/prometheus_connect.py#L160-L161
https://github.com/AICoE/prometheus-api-client-python/blob/v0.0.2/prometheus_api_client/prometheus_connect.py#L237
Maybe we can add some unit tests for this
More details on this bug https://github.com/scrapinghub/dateparser/issues/549
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