metricq / metricq-python

🐍 The MetricQ Python interface
https://metricq.github.io/metricq-python/
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

HistoryResponse iterator should be able to be traversed multiple times #126

Open bmario opened 2 years ago

bmario commented 2 years ago

The following code should work:

c = HistoryClient(...)
await c.connect()
response = await c.history_raw_timeline(...)
data = [(timestamp, value) for timestamp, value in response]
assert len(data) > 0
data = [(timestamp, value) for timestamp, value in response]
assert len(data) > 0 # this fails :(

This makes MetricQ hard to use in jupyter notebooks