Added NaN repr field in export popup
This commit is contained in:
@ -163,7 +163,7 @@ class InfluxGraph:
|
||||
self.livemode = self.LIVE
|
||||
return dict(type='accept-graph', live=True)
|
||||
|
||||
def w_export(self, variables, time, interval):
|
||||
def w_export(self, variables, time, nan, interval):
|
||||
"""
|
||||
Returns the bytes of a dataframe with the curves given by variables in the time range "time"
|
||||
Called when the route /export is reached.
|
||||
@ -171,6 +171,7 @@ class InfluxGraph:
|
||||
Parameters :
|
||||
variables (str) : a comma separataed value string of variable names (influx names) to retrieve
|
||||
time (str) : a commma separated value string (range) of seconds.
|
||||
nan (str) : the representation for NaN values in the TSV
|
||||
interval (str) : the interval (resolution) of the values to get (string in seconds)
|
||||
|
||||
Returns :
|
||||
@ -187,7 +188,7 @@ class InfluxGraph:
|
||||
df = self.influx_data_getter.get_curves_data_frame(queried_variables, [start, end], interval)
|
||||
|
||||
mem = io.BytesIO()
|
||||
df.to_csv(mem, sep="\t", index=False, float_format="%.15g")
|
||||
df.to_csv(mem, sep="\t", index=False, float_format="%.15g", na_rep=nan)
|
||||
mem.seek(0)
|
||||
return mem
|
||||
|
||||
|
Reference in New Issue
Block a user