Skip to content

Commit

Permalink
Always initialise values with an empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman committed Nov 27, 2023
1 parent 1e801d6 commit 9282211
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions metrics/timescaledb/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9282211

Please sign in to comment.