From 4034a12f62475c7a1a9474ba1126d3008e6e8cb1 Mon Sep 17 00:00:00 2001 From: Friedrich Lindenberg Date: Sun, 23 Aug 2020 12:30:30 +0200 Subject: [PATCH] Get rid of the flush statement, but I'm not sure this has no side effects --- dataset/table.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dataset/table.py b/dataset/table.py index 1459a30..823071a 100644 --- a/dataset/table.py +++ b/dataset/table.py @@ -77,10 +77,6 @@ class Table(object): self._columns[key] = name return self._columns - def _flush_metadata(self): - with self.db.lock: - self._columns = None - @property def columns(self): """Get a listing of all columns that exist in the table.""" @@ -312,7 +308,7 @@ class Table(object): def _reflect_table(self): """Load the tables definition from the database.""" with self.db.lock: - self._flush_metadata() + self._columns = None try: self._table = SQLATable( self.name, self.db.metadata, schema=self.db.schema, autoload=True @@ -331,7 +327,6 @@ class Table(object): def _sync_table(self, columns): """Lazy load, create or adapt the table structure in the database.""" - self._flush_metadata() if self._table is None: # Load an existing table from the database. self._reflect_table()