فهرست منبع

bug fix: ... minor update sqlalchemy

Steve Nyemba 3 سال پیش
والد
کامیت
6c406407b2
3فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 1 1
      setup.py
  2. 1 0
      transport/__init__.py
  3. 3 2
      transport/sql.py

+ 1 - 1
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"]}

+ 1 - 0
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:

+ 3 - 2
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] :