From e8edf886adfc0bd4e05b9ff40b137cc9667beb77 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Fri, 10 Jun 2022 13:00:28 -0500 Subject: [PATCH] bug fix: write data --- data/maker/__init__.py | 7 ++++--- setup.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 403255c..1666a42 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -380,18 +380,19 @@ class Generator (Learner): _schema = self.get_schema() - _schema = [{'name':_item.name,'type':_item.field_type} for _item in _schema] + _schema = [{'name':_item.name,'type':(_item.field_type if has_attr(_item,'field_type') else 'VARCHAR(256)')} for _item in _schema] _df = self.format(_df,_schema) _log = [{"name":_schema[i]['name'],"dataframe":_df[_df.columns[i]].dtypes.name,"schema":_schema[i]['type']} for i in np.arange(len(_schema)) ] self.log(**{"action":"consolidate","input":_log}) # w = transport.factory.instance(doc='observation',provider='mongodb',context='write',db='IOV01_LOGS',auth_file='/home/steve/dev/transport/mongo.json') # w.write(_df) - cols = [name for name in _df.columns if name.endswith('datetime')] + # cols = [name for name in _df.columns if name.endswith('datetime')] + # print (_df[cols]) writer = transport.factory.instance(**_store) - writer.write(_df[cols],schema=[_item for _item in _schema if _item['name'] in cols]) + writer.write(_df,schema=[_item for _item in _schema if _item['name'] in cols]) diff --git a/setup.py b/setup.py index b5d3733..8da19f3 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import sys def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -args = {"name":"data-maker","version":"1.5.4", +args = {"name":"data-maker","version":"1.5.5", "author":"Vanderbilt University Medical Center","author_email":"steve.l.nyemba@vumc.org","license":"MIT", "packages":find_packages(),"keywords":["healthcare","data","transport","protocol"]} args["install_requires"] = ['data-transport@git+https://dev.the-phi.com/git/steve/data-transport.git','tensorflow']