From 84e212d5a3ef0eeef4957d421c04604827ff420b Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 13 Apr 2021 17:27:23 -0500 Subject: [PATCH] bug fix: lock, parallel processing bigquery --- setup.py | 2 +- transport/sql.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index f316e24..862dbaa 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() args = { "name":"data-transport", - "version":"1.3.8.1", + "version":"1.3.8.2", "author":"The Phi Technology LLC","author_email":"info@the-phi.com", "license":"MIT", "packages":["transport"]} diff --git a/transport/sql.py b/transport/sql.py index dcf9e15..cd4aa2c 100644 --- a/transport/sql.py +++ b/transport/sql.py @@ -238,11 +238,11 @@ class BQWriter(BigQuery,Writer): def write(self,_info,**_args) : try: if self.parallel : - self.lock.acquire() + BQWriter.lock.acquire() self._write(_info,**_args) finally: if self.parallel: - self.lock.release() + BQWriter.lock.release() def _write(self,_info,**_args) : _df = None if type(_info) in [list,pd.DataFrame] :