bug fix: lock, parallel processing bigquery

This commit is contained in:
Steve Nyemba 2021-04-13 17:27:23 -05:00
parent afcc5ed690
commit 84e212d5a3
2 changed files with 3 additions and 3 deletions

View File

@ -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"]}

View File

@ -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] :