Browse Source

bug fix: adding types to read function

Steve Nyemba 4 years ago
parent
commit
b5eb5e0991
2 changed files with 4 additions and 3 deletions
  1. 1 1
      setup.py
  2. 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.3.8.3",
+    "version":"1.3.8.4",
     "author":"The Phi Technology LLC","author_email":"info@the-phi.com",
     "license":"MIT",
     "packages":["transport"]}

+ 3 - 2
transport/sql.py

@@ -228,10 +228,11 @@ class BQReader(BigQuery,Reader) :
             SQL = SQL.replace(':dataset',self.dataset).replace(':DATASET',self.dataset)
         _info = {'credentials':self.credentials,'dialect':'standard'}
         if 'dtypes' in _args  or self.dtypes :
-            self.dtypes = _args ['dtypes'] if 'dtypes' in self.dtypes else None
+            if not self.dtypes :
+                self.dtypes = _args ['dtypes'] if 'dtypes' in _args else None
             if self.dtypes :
                 _info['dtypes'] = self.dtypes
-        return pd.read_gbq(SQL,*_info) if SQL else None    
+        return pd.read_gbq(SQL,**_info) if SQL else None    
         # return pd.read_gbq(SQL,credentials=self.credentials,dialect='standard') if SQL else None
 class BQWriter(BigQuery,Writer):
     lock = Lock()