You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/15 05:24:40 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #19571: :pencil: (providers_google) add a location check

uranusjr commented on a change in pull request #19571:
URL: https://github.com/apache/airflow/pull/19571#discussion_r749012799



##########
File path: airflow/providers/google/cloud/hooks/bigquery.py
##########
@@ -2630,6 +2630,11 @@ def run_query(self, *args, **kwargs) -> str:
             stacklevel=3,
         )
         return self.hook.run_query(*args, **kwargs)
+    
+    def get_records(self, sql, parameters=None):
+        if self.location is None:
+            raise Exception("Need to specify location when instantiating BigQueryHook, otherwise it would result in Job Not Found error!")

Review comment:
       Instead of failing on runtime, can we instead detect this in `__init__` and fail the entire DAG when `location` is invalid? Or is `location=None` a valid value for certain use cases?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org