Skip to content

Commit 6909575

Browse files
author
Anand Sanmukhani
authored
Update metric.py
When converting json to a pandas df, it should raise errors when converting string to numbers instead of just ignoring them. This was updated in pandas v0.25.0
1 parent e97a9cf commit 6909575

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prometheus_api_client/metric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self, metric, oldest_data_datetime=None):
6464
metric["values"] = [metric["value"]]
6565

6666
self.metric_values = pandas.DataFrame(metric["values"], columns=["ds", "y"]).apply(
67-
pandas.to_numeric, args=({"errors": "coerce"})
67+
pandas.to_numeric, errors="raise"
6868
)
6969
self.metric_values["ds"] = pandas.to_datetime(self.metric_values["ds"], unit="s")
7070

0 commit comments

Comments
 (0)