Skip to content

Commit

Permalink
Fix bug in bigquery.py where the bq to table logic was referencing a …
Browse files Browse the repository at this point in the history
…different method

Change-Id: I68192c3795ecfa73797e75d85b7e236445af3526
  • Loading branch information
anaesqueda committed Jun 5, 2023
1 parent 85c5e4d commit e096b37
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bqflow/task/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def bigquery_query_to_table(config, task):
)


def bigquery_query_to_table(config, task):
def bigquery_query_to_sheet(config, task):
"""Execute a query and write results to sheet."""

if config.verbose:
Expand All @@ -102,11 +102,11 @@ def bigquery_query_to_table(config, task):
legacy=task['from'].get('legacy', False)
)

put_rows(
data.put_rows(
config=config,
auth=auth,
auth=task['auth'],
destination = { 'sheets': {
'auth':task['to'].get('auth', auth),
'auth':task['to'].get('auth', task['auth']),
'sheet':task['to']['sheet'],
'tab':task['to']['tab'],
'range':task['to'].get('range', 'A2'),
Expand Down Expand Up @@ -135,7 +135,7 @@ def bigquery_query_to_view(config, task):
)


def bigquery_storage(config, task):
def bigquery_storage_to_table(config, task):
"""Read from storage into a table."""

if config.verbose:
Expand All @@ -146,7 +146,7 @@ def bigquery_storage(config, task):
dataset_id = task['to']['dataset'],
table_id = task['to']['table'],
path = task['from']['bucket'] + ':' + task['from']['path'],
schema = task.get('schema'),
schema = task.get('schema'),
header = task.get('header', False),
structure = task.get('structure', 'CSV'),
disposition = task.get('disposition', 'WRITE_TRUNCATE')
Expand All @@ -169,6 +169,6 @@ def bigquery(config, log, task):
else:
raise NotImplementedError('The bigquery task has no such handler.')
elif 'bucket' in task['from']:
bigquery_query(config, task)
bigquery_storage_to_table(config, task)
else:
raise NotImplementedError('The bigquery task has no such handler.')
raise NotImplementedError('The bigquery task has no such handler.')

0 comments on commit e096b37

Please sign in to comment.