From 92822118e212aab37239bf7678399a7bde7f17fe Mon Sep 17 00:00:00 2001 From: George Hickman Date: Fri, 24 Nov 2023 16:13:26 +0000 Subject: [PATCH] Always initialise values with an empty list --- metrics/timescaledb/writer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/metrics/timescaledb/writer.py b/metrics/timescaledb/writer.py index 0a1aec5c..2c0b670d 100644 --- a/metrics/timescaledb/writer.py +++ b/metrics/timescaledb/writer.py @@ -31,14 +31,13 @@ def ensure_table(engine, table): class TimescaleDBWriter: - values = [] - def __init__(self, table, engine=None): if engine is None: engine = create_engine(TIMESCALEDB_URL) self.engine = engine self.table = table + self.values = [] def __enter__(self): ensure_table(self.engine, self.table)