Closed NotoriousBIT closed 4 years ago
In response_parser.ts the value is parsed with parseValue().
parseValue()
export function getTimeSeriesFromResult(result: string) { const { data } = parseCSV(result); ... const datapoints = series.map(record => [parseValue(record['_value']), parseTime(getTimeRec(record))]); ... }
The problem is, parseValue() only allows Numbers. So if the value is a String, it returns null.
Numbers
value
String
null
To solve this problem parseValueWithType() should be used instead.
parseValueWithType()
export function getTimeSeriesFromResult(result: string) { const { data, types } = parseCSV(result); ... const datapoints = series.map(record => [parseValueWithType(record['_value'], types['_value']), parseTime(getTimeRec(record))]); ... }
In response_parser.ts the value is parsed with
parseValue()
.The problem is,
parseValue()
only allowsNumbers
. So if thevalue
is aString
, it returnsnull
.To solve this problem
parseValueWithType()
should be used instead.