Skip to content

Commit

Permalink
(providers_google) add a location check in bigquery (#19571)
Browse files Browse the repository at this point in the history
  • Loading branch information
david30907d committed Feb 13, 2022
1 parent 6579648 commit 6bb0857
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions airflow/providers/google/cloud/hooks/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ def get_sqlalchemy_engine(self, engine_kwargs=None):
"and extra__google_cloud_platform__keyfile_dict"
)

def get_records(self, sql, parameters=None):
if self.location is None:
raise AirflowException("Need to specify 'location' to use BigQueryHook.get_records()")
return super().get_records(sql, parameters=parameters)

@staticmethod
def _resolve_table_reference(
table_resource: Dict[str, Any],
Expand Down

0 comments on commit 6bb0857

Please sign in to comment.