More informative messages for scald Influx queries (Feature request/Bug Fix)
Currently, when querying data from InfluxDB using scald tools, the _query_influx_data()
method of the Consumer
class does not return useful information upon an unsuccessful query. For example, querying a time for which no data exists returns the same error when querying a non-existent measurement for a time when data does exist:
File "/cvmfs/software.igwn.org/conda/envs/igwn/lib/python3.10/site-packages/ligo/scald/io/influx.py", line 1339, in _query_influx_data
return data['results'][0]['series'][0]['columns'], data['results'][0]['series'][0]['values']
KeyError: 'series'
For reproducibility, the above error message was produced by running /home/matthew.carney/projects/influx_test.py
on the LIGO Hanford cluster. As stated above this same message was produced for both of the aforementioned cases.
It would be very helpful for debugging purposes if there was a way to differentiate between error causes when querying is unsuccessful. Both my calibration Influx querying code ligo-calibplot and the portion of pydarm that adapts ligo-calibplot rely on this scald submodule, so there are downstream implications to this request as well.