diff --git a/setup.py b/setup.py index c4ca8ea..971f538 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.4.5", + "version":"1.4.6", "author":"The Phi Technology LLC","author_email":"info@the-phi.com", "license":"MIT", "packages":["transport"]} diff --git a/transport/__init__.py b/transport/__init__.py index 6642c4e..1feca91 100644 --- a/transport/__init__.py +++ b/transport/__init__.py @@ -164,6 +164,7 @@ def instance(**_args): e = sqlalchemy.create_engine (uri,future=True) args['sqlalchemy'] = e + # # @TODO: Include handling of bigquery with SQLAlchemy except Exception as e: diff --git a/transport/sql.py b/transport/sql.py index 19d8ecc..a0893a9 100644 --- a/transport/sql.py +++ b/transport/sql.py @@ -195,7 +195,7 @@ class SQLWriter(SQLRW,Writer): sql = " ".join(["CREATE TABLE",table," (", ",".join([ name +' '+ self._dtype for name in fields]),")"]) else: - schema = _args['schema'] if 'schema' in _args else '' + schema = _args['schema'] if 'schema' in _args else [] _map = _args['map'] if 'map' in _args else {} sql = [] # ["CREATE TABLE ",_args['table'],"("] @@ -208,7 +208,7 @@ class SQLWriter(SQLRW,Writer): # table = self._tablename(_args['table']) sql = ["CREATE TABLE ",table,"( ",sql," )"] sql = " ".join(sql) - # sql = " ".join(["CREATE TABLE",_args['table']," (", ",".join([ schema[i]['name'] +' '+ (schema[i]['type'] if schema[i]['type'] not in _map else _map[schema[i]['type'] ]) for i in range(0,N)]),")"]) + cursor = self.conn.cursor() try: @@ -262,6 +262,7 @@ class SQLWriter(SQLRW,Writer): return SQLRW.lock.acquire() + if self._engine is not None: # pd.to_sql(_info,self._engine) if self.schema in ['',None] :