From 95ad4c1a6b5cac653ad1d57f7bca1e61570737c1 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Mon, 19 Feb 2024 15:36:09 -0600 Subject: [PATCH 1/2] version 2.0-RC (2024) --- info/__init__.py | 2 +- setup.py | 18 +----------------- transport/sql.py | 5 +++-- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/info/__init__.py b/info/__init__.py index 1ff6503..9e789d5 100644 --- a/info/__init__.py +++ b/info/__init__.py @@ -1,5 +1,5 @@ __author__ = 'The Phi Technology' -__version__= '1.9.8' +__version__= '2.0-RC' __license__=""" diff --git a/setup.py b/setup.py index 9eb2c3e..df12cb4 100644 --- a/setup.py +++ b/setup.py @@ -20,26 +20,10 @@ args = { "license":"MIT", "packages":["transport","info"]} args["keywords"]=['mongodb','couchdb','rabbitmq','file','read','write','s3','sqlite'] -args["install_requires"] = ['pyncclient','pymongo','sqlalchemy<2.0.0','pandas','typer','pandas-gbq','numpy','cloudant','pika','nzpy','boto3','boto','pyarrow','google-cloud-bigquery','google-cloud-bigquery-storage','flask-session','smart_open','botocore','psycopg2-binary','mysql-connector-python'] +args["install_requires"] = ['pyncclient','pymongo','sqlalchemy','pandas','typer','pandas-gbq','numpy','cloudant','pika','nzpy','boto3','boto','pyarrow','google-cloud-bigquery','google-cloud-bigquery-storage','flask-session','smart_open','botocore','psycopg2-binary','mysql-connector-python'] args["url"] = "https://healthcareio.the-phi.com/git/code/transport.git" args['scripts'] = ['bin/transport'] if sys.version_info[0] == 2 : args['use_2to3'] = True args['use_2to3_exclude_fixers']=['lib2to3.fixes.fix_import'] setup(**args) -# setup( -# name = "data-transport", -# version = "1.0", -# author = "The Phi Technology LLC", -# author_email = "steve@the-phi.com", -# license = "MIT", -# packages=['transport'], -# keywords=['mongodb','couchdb','rabbitmq','file','read','write','s3'], -# install_requires = ['pymongo','numpy','cloudant','pika','boto','flask-session','smart_open'], -# url="https://dev.the-phi.com/git/steve/data-transport.git", -# use_2to3=True, -# long_description=read('README.md'), -# convert_2to3_doctests=['README.md'], -# #use_2to3_fixers=['your.fixers'], -# use_2to3_exclude_fixers=['lib2to3.fixes.fix_import'], -# ) diff --git a/transport/sql.py b/transport/sql.py index 3176cf7..c5b52d4 100644 --- a/transport/sql.py +++ b/transport/sql.py @@ -29,6 +29,7 @@ from google.cloud import bigquery as bq from multiprocessing import Lock, RLock import pandas as pd +import pandas_gbq as pd_gbq import numpy as np import nzpy as nz #--- netezza drivers import sqlite3 @@ -409,7 +410,7 @@ class BigQuery: _dataset = self.dataset if 'dataset' not in _args else _args['dataset'] sql = f"""SELECT column_name as name, data_type as type FROM {_dataset}.INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{table}' """ _info = {'credentials':self.credentials,'dialect':'standard'} - return pd.read_gbq(sql,**_info).to_dict(orient='records') + return pd_gbq.read_gbq(sql,**_info).to_dict(orient='records') # return self.read(sql=sql).to_dict(orient='records') # ref = self.client.dataset(self.dataset).table(table) @@ -451,7 +452,7 @@ class BQReader(BigQuery,Reader) : if (':dataset' in SQL or ':DATASET' in SQL) and self.dataset: SQL = SQL.replace(':dataset',self.dataset).replace(':DATASET',self.dataset) _info = {'credentials':self.credentials,'dialect':'standard'} - return pd.read_gbq(SQL,**_info) if SQL else None + return pd_gbq.read_gbq(SQL,**_info) if SQL else None # return self.client.query(SQL).to_dataframe() if SQL else None From 8d2eb62218f2935f734cd1dc355b5f5f132a4325 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 20 Feb 2024 09:08:05 -0600 Subject: [PATCH 2/2] bug fix with 2024 pandas & sqlalchemy --- info/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info/__init__.py b/info/__init__.py index 9e789d5..9ffaa4d 100644 --- a/info/__init__.py +++ b/info/__init__.py @@ -1,5 +1,5 @@ __author__ = 'The Phi Technology' -__version__= '2.0-RC' +__version__= '1.9.8.1' __license__="""