|
|
@ -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):
|
|
|
|