Taragolis commented on code in PR #38430:
URL: https://github.com/apache/airflow/pull/38430#discussion_r1545729900


##########
airflow/providers/google/cloud/hooks/bigquery.py:
##########
@@ -82,32 +83,113 @@ class BigQueryHook(GoogleBaseHook, DbApiHook):
 
     This hook uses the Google Cloud connection.
 
-    :param gcp_conn_id: The Airflow connection used for GCP credentials.
     :param use_legacy_sql: This specifies whether to use legacy SQL dialect.
     :param location: The location of the BigQuery resource.
     :param priority: Specifies a priority for the query.
         Possible values include INTERACTIVE and BATCH.
         The default value is INTERACTIVE.
     :param api_resource_configs: This contains params configuration applied for
         Google BigQuery jobs.
-    :param impersonation_chain: This is the optional service account to

Review Comment:
   Unfortunetly docstring doesn't work by that way, so it would be missed into 
the IDE suggestion as well into the API reference



##########
airflow/providers/google/cloud/hooks/bigquery.py:
##########
@@ -82,32 +83,61 @@ class BigQueryHook(GoogleBaseHook, DbApiHook):
 
     This hook uses the Google Cloud connection.
 
-    :param gcp_conn_id: The Airflow connection used for GCP credentials.
     :param use_legacy_sql: This specifies whether to use legacy SQL dialect.
     :param location: The location of the BigQuery resource.
     :param priority: Specifies a priority for the query.
         Possible values include INTERACTIVE and BATCH.
         The default value is INTERACTIVE.
     :param api_resource_configs: This contains params configuration applied for
         Google BigQuery jobs.
-    :param impersonation_chain: This is the optional service account to
-        impersonate using short term credentials.
-    :param labels: The BigQuery resource label.
+    :param labels: The BigQuery resource labels.
     """
 
     conn_name_attr = "gcp_conn_id"
     default_conn_name = "google_cloud_bigquery_default"
     conn_type = "gcpbigquery"
     hook_name = "Google Bigquery"
 
+    @classmethod
+    def get_connection_form_widgets(cls) -> dict[str, Any]:
+        """Return connection widgets to add to connection form."""
+        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
+        from flask_babel import lazy_gettext
+        from wtforms import validators
+        from wtforms.fields.simple import BooleanField, StringField
+
+        from airflow.www.validators import ValidJson
+
+        connection_form_widgets = super().get_connection_form_widgets()
+        connection_form_widgets["use_legacy_sql"] = 
BooleanField(lazy_gettext("Use Legacy SQL"), default=True)
+        connection_form_widgets["location"] = StringField(
+            lazy_gettext("Location"), widget=BS3TextFieldWidget()
+        )
+        connection_form_widgets["priority"] = StringField(
+            lazy_gettext("Priority"),
+            default="INTERACTIVE",
+            widget=BS3TextFieldWidget(),
+            validators=[validators.AnyOf(["INTERACTIVE", "BATCH"])],
+        )
+        connection_form_widgets["api_resource_configs"] = StringField(
+            lazy_gettext("API Resource Configs"), widget=BS3TextFieldWidget(), 
validators=[ValidJson()]
+        )
+        connection_form_widgets["labels"] = StringField(
+            lazy_gettext("Labels"), widget=BS3TextFieldWidget(), 
validators=[ValidJson()]
+        )
+        return connection_form_widgets
+
+    @classmethod
+    def get_ui_field_behaviour(cls) -> dict[str, Any]:
+        """Return custom field behaviour."""
+        return super().get_ui_field_behaviour()

Review Comment:
   ```suggestion
       @classmethod
       def get_ui_field_behaviour(cls) -> dict[str, Any]:
           """Return custom field behaviour."""
           return super().get_ui_field_behaviour()
   ```
   
   Looks redundand if it only required to call super method



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to