From 3aa4ad64bc612f33755dc36d07cb9cf37a2b492a Mon Sep 17 00:00:00 2001 From: Matt Delacour Date: Wed, 30 Jun 2021 14:03:06 -0400 Subject: [PATCH] BQ exception should be raised first before we check the timedout Signed-off-by: Matt Delacour --- sdk/python/feast/infra/offline_stores/bigquery.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery.py b/sdk/python/feast/infra/offline_stores/bigquery.py index bcfc5f08f4..681c7e9478 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery.py +++ b/sdk/python/feast/infra/offline_stores/bigquery.py @@ -286,13 +286,13 @@ def _wait_until_done(job_id): job_id = bq_job.job_id _wait_until_done(job_id=job_id) + if bq_job.exception(): + raise bq_job.exception() + if not _is_done(job_id): client.cancel_job(job_id) raise BigQueryJobCancelled(job_id=job_id) - if bq_job.exception(): - raise bq_job.exception() - @dataclass(frozen=True) class FeatureViewQueryContext: