simonsobs / sisock

Sisock ('saɪsɒk): streaming of Simons Obs. data over websockets for quicklook
Other
2 stars 0 forks source link

No data returned if single field query fails #25

Closed BrianJKoopman closed 5 years ago

BrianJKoopman commented 5 years ago

If a Grafana panel is setup to display a set of fields from sisock and a single one of the fields doesn't have data to display then no data is displayed. Grafana produces an error similar to this:

web.Server Traceback (most recent call last)web.Server Traceback (most recent call last):
builtins.KeyError: 'channel_08'
/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py:1418 in _inlineCallbacks
1417            else:
1418                result = g.send(result)
1419        except StopIteration as e:
grafana_http_json.py:249 in _query
248                # sisock's response, and convert to milliseconds.
249                tl_name = self._field[data_node][0][f]["timeline"]
250                tl = np.array(data["timeline"][tl_name]["t"]) * 1000.0
builtins.KeyError: 'channel_08'

This KeyError should be caught in such a way as to allow Grafana to display the remaining data if possible.

Steps to Reproduce

BrianJKoopman commented 5 years ago

Fixed by #26