xinbinhuang commented on a change in pull request #12677:
URL: https://github.com/apache/airflow/pull/12677#discussion_r582181372



##########
File path: airflow/providers/google/cloud/hooks/bigquery.py
##########
@@ -69,8 +69,8 @@ class BigQueryHook(GoogleBaseHook, DbApiHook):
 
     conn_name_attr = 'gcp_conn_id'
     default_conn_name = 'google_cloud_default'
-    conn_type = 'google_cloud_platform'
-    hook_name = 'Google Cloud'
+    conn_type = 'bigquery'
+    hook_name = 'BigQuery'

Review comment:
       I left a comment about this previously, but I think it got buried over 
time. Here I copy my original comment here.
   
   This fixes the issue where conn.get_hook will never return the bigquery hook 
because GoogleBaseHook "hides" the BigQueryHook as they have the same conn_type.
   
   > Yes, there is one place that may be considered fixing rather than 
breaking. For airflow/providers/google/cloud/hooks/bigquery.py, I changed the 
hook's conn_type and hook_name from google cloud platform/Google Cloud to 
bigquery/BigQuery. This fixes the issue where conn.get_hook will never return 
the bigquery hook because GoogleBaseHook "hides" the BigQueryHook as they have 
the same conn_type.

##########
File path: airflow/providers/google/cloud/hooks/bigquery.py
##########
@@ -69,8 +69,8 @@ class BigQueryHook(GoogleBaseHook, DbApiHook):
 
     conn_name_attr = 'gcp_conn_id'
     default_conn_name = 'google_cloud_default'
-    conn_type = 'google_cloud_platform'
-    hook_name = 'Google Cloud'
+    conn_type = 'bigquery'
+    hook_name = 'BigQuery'

Review comment:
       I left a comment about this previously, but I think it got buried over 
time. 
   
   This fixes the issue where conn.get_hook will never return the bigquery hook 
because GoogleBaseHook "hides" the BigQueryHook as they have the same conn_type.
   
   > Yes, there is one place that may be considered fixing rather than 
breaking. For airflow/providers/google/cloud/hooks/bigquery.py, I changed the 
hook's conn_type and hook_name from google cloud platform/Google Cloud to 
bigquery/BigQuery. This fixes the issue where conn.get_hook will never return 
the bigquery hook because GoogleBaseHook "hides" the BigQueryHook as they have 
the same conn_type.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to