This commit is contained in:
Steve Nyemba 2023-07-05 14:51:14 -05:00
parent aaaf64db33
commit 74d8b2c6f2
2 changed files with 8 additions and 6 deletions

View File

@ -8,7 +8,7 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()
args = { args = {
"name":"data-transport", "name":"data-transport",
"version":"1.7.2", "version":"1.7.4",
"author":"The Phi Technology LLC","author_email":"info@the-phi.com", "author":"The Phi Technology LLC","author_email":"info@the-phi.com",
"license":"MIT", "license":"MIT",
"packages":["transport"]} "packages":["transport"]}

View File

@ -380,12 +380,14 @@ class BigQuery:
:param table name of the name WITHOUT including dataset :param table name of the name WITHOUT including dataset
:param sql sql query to be pulled, :param sql sql query to be pulled,
""" """
table = _args['table'] table = _args['table'] if 'table' in _args else self.table
try: try:
if table :
ref = self.client.dataset(self.dataset).table(table) ref = self.client.dataset(self.dataset).table(table)
_schema = self.client.get_table(ref).schema _schema = self.client.get_table(ref).schema
return [{"name":_item.name,"type":_item.field_type,"description":( "" if not hasattr(_item,"description") else _item.description )} for _item in _schema] return [{"name":_item.name,"type":_item.field_type,"description":( "" if not hasattr(_item,"description") else _item.description )} for _item in _schema]
else :
return []
except Exception as e: except Exception as e:
return [] return []
def has(self,**_args): def has(self,**_args):