From 2a641b3c833321c7c1394a9a2a39aefe80bf08c4 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Sat, 6 Feb 2021 12:08:43 -0600 Subject: [PATCH] bug fix --- healthcareio/export/export.py | 1 + healthcareio/export/workers.py | 10 +++++++++- healthcareio/healthcare-io.py | 2 ++ setup.py | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/healthcareio/export/export.py b/healthcareio/export/export.py index 0dd52bd..5d29888 100644 --- a/healthcareio/export/export.py +++ b/healthcareio/export/export.py @@ -216,6 +216,7 @@ class Factory: for row in job_args: # _store = json.loads(json.dumps(wstore)) _store = copy.deepcopy(wstore) + _store['args']['table'] = row['table'] _pipe = [ workers.CreateSQL(prefix=PREFIX,schema=SCHEMA,store=_store,sql=row['sql']), diff --git a/healthcareio/export/workers.py b/healthcareio/export/workers.py index 47dec96..a9aff6e 100644 --- a/healthcareio/export/workers.py +++ b/healthcareio/export/workers.py @@ -17,6 +17,7 @@ class Subject (Process): self.observers = _args['observers'] self.index = 0 self.name = _args['name'] + self.table = self.observers[1].table pass def run(self): self.notify() @@ -58,6 +59,10 @@ class Worker : def execute(self): try: self._apply() + except Exception as error: + print () + print (error) + print () finally: self.caller.notify() @@ -137,7 +142,10 @@ class Reader(Worker): def _apply(self): self.reader = transport.factory.instance(**self._info) ; - + print() + print (self.table) + print (json.dumps(self.pipeline)) + print () self.rows = self.reader.read(mongo=self.pipeline) N = len(self.rows) / self.MAX_ROWS if len(self.rows) > self.MAX_ROWS else 1 diff --git a/healthcareio/healthcare-io.py b/healthcareio/healthcare-io.py index 61d4d8d..88907ff 100644 --- a/healthcareio/healthcare-io.py +++ b/healthcareio/healthcare-io.py @@ -392,6 +392,8 @@ if __name__ == '__main__' : pipes = export.Factory.instance(type=TYPE,write_store=_store) #"inspect":0,"cast":0}}) # pipes[0].run() for thread in pipes: + if 'table' in SYS_ARGS and SYS_ARGS['table'] != thread.table : + continue thread.start() time.sleep(1) while pipes : diff --git a/setup.py b/setup.py index e5b5d53..ff85749 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ import sys def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() args = { - "name":"healthcareio","version":"1.5.9", + "name":"healthcareio","version":"1.5.9.1", "author":"Vanderbilt University Medical Center", "author_email":"steve.l.nyemba@vumc.org", "include_package_data":True,