Merge pull request 'bigquery updates: meta' (#1) from dev into master

Reviewed-on: utilities-tools/data-transport#1
pull/2/head^2
Steve L. Nyemba 1 year ago
commit 77545136a5

@ -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.4", "version":"1.7.6",
"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"]}

@ -385,7 +385,7 @@ class BigQuery:
try: try:
if table : if table :
_dataset = self.dataset if 'dataset' not in _args else _args['dataset'] _dataset = self.dataset if 'dataset' not in _args else _args['dataset']
sql = f"""SELECT column_name as table_name, data_type as field_type FROM {_dataset}.INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{table}' """ sql = f"""SELECT column_name as field_name, data_type as field_type FROM {_dataset}.INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{table}' """
return self.read(sql=sql).to_dict(orient='records') return self.read(sql=sql).to_dict(orient='records')
# ref = self.client.dataset(self.dataset).table(table) # ref = self.client.dataset(self.dataset).table(table)

Loading…
Cancel
Save