Skip to content

Commit

Permalink
Fix dry_run bug that was making to_bigquery hang indefinitely (#1706)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Lin <codyl@twitter.com>
  • Loading branch information
codyjlin authored Jul 12, 2021
1 parent 0d2179d commit 0d0492d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,17 @@ def to_bigquery(self, job_config: bigquery.QueryJobConfig = None) -> Optional[st

bq_job = self.client.query(self.query, job_config=job_config)

block_until_done(client=self.client, bq_job=bq_job)

if bq_job.exception():
raise bq_job.exception()

if job_config.dry_run:
print(
"This query will process {} bytes.".format(bq_job.total_bytes_processed)
)
return None

block_until_done(client=self.client, bq_job=bq_job)

if bq_job.exception():
raise bq_job.exception()

print(f"Done writing to '{job_config.destination}'.")
return str(job_config.destination)

Expand Down

0 comments on commit 0d0492d

Please sign in to comment.