Accessing FluxRecord fields that are not returned by result result panic (flux count(), pivot())
When executing FluxRecord.Time() for query that does aggregation Go panics interface conversion: interface {} is nil, not time.Time
This is because these results do not have _time field in result and nil can not be cast to time.Time
There are other methods that could panic in same way Start/Stop/Value etc. For example Flux function pivot() does not return _value column
I think allowing those methods to panic is little bit too much. Adding second field indicating if value exists - similarly as getting value from map val, ok := mymap[key] would have maybe less surprising results and not that punishing API.
Example query:
text
from(bucket:"data/autogen")
|> range(start: 2021-03-22T16:05:20+02:00)
|> filter(fn:(r) => r._measurement == "position" and (r._field =="latitude") and (r.type == "main"))
|> count()