Skip to content

Commit 6bb0857

Browse files
authored
(providers_google) add a location check in bigquery (#19571)
1 parent 6579648 commit 6bb0857

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

airflow/providers/google/cloud/hooks/bigquery.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ def get_sqlalchemy_engine(self, engine_kwargs=None):
189189
"and extra__google_cloud_platform__keyfile_dict"
190190
)
191191

192+
def get_records(self, sql, parameters=None):
193+
if self.location is None:
194+
raise AirflowException("Need to specify 'location' to use BigQueryHook.get_records()")
195+
return super().get_records(sql, parameters=parameters)
196+
192197
@staticmethod
193198
def _resolve_table_reference(
194199
table_resource: Dict[str, Any],

0 commit comments

Comments
 (0)