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 2020/05/16 14:35:41 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #8858: Refactor BigQuery operators

mik-laj commented on a change in pull request #8858:
URL: https://github.com/apache/airflow/pull/8858#discussion_r426158884



##########
File path: airflow/providers/google/cloud/operators/bigquery.py
##########
@@ -1334,27 +1388,30 @@ class BigQueryUpdateDatasetOperator(BaseOperator):
     ui_color = BigQueryUIColors.DATASET.value
 
     @apply_defaults
-    def __init__(self,
-                 dataset_resource: dict,
-                 dataset_id: Optional[str] = None,
-                 project_id: Optional[str] = None,
-                 gcp_conn_id: str = 'google_cloud_default',
-                 delegate_to: Optional[str] = None,
-                 *args, **kwargs) -> None:
+    def __init__(
+        self,
+        dataset_resource: dict,
+        fields: Optional[List[str]] = None,

Review comment:
       Hint: ``@apply_defaults``

##########
File path: airflow/providers/google/cloud/operators/bigquery.py
##########
@@ -741,28 +747,38 @@ class BigQueryCreateEmptyTableOperator(BaseOperator):
                 https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#clustering.fields
     :type cluster_fields: list
     """
-    template_fields = ('dataset_id', 'table_id', 'project_id',
-                       'gcs_schema_object', 'labels', 'view')
+    template_fields = (
+        'dataset_id',
+        'table_id',
+        'project_id',
+        'gcs_schema_object',
+        'labels',
+        'view'
+    )
+
     ui_color = BigQueryUIColors.TABLE.value
 
     # pylint: disable=too-many-arguments
     @apply_defaults
-    def __init__(self,
-                 dataset_id: str,
-                 table_id: str,
-                 project_id: Optional[str] = None,
-                 schema_fields: Optional[List] = None,
-                 gcs_schema_object: Optional[str] = None,
-                 time_partitioning: Optional[Dict] = None,
-                 bigquery_conn_id: str = 'google_cloud_default',
-                 google_cloud_storage_conn_id: str = 'google_cloud_default',
-                 delegate_to: Optional[str] = None,
-                 labels: Optional[Dict] = None,
-                 view: Optional[Dict] = None,
-                 encryption_configuration: Optional[Dict] = None,
-                 location: Optional[str] = None,
-                 cluster_fields: Optional[List[str]] = None,
-                 *args, **kwargs) -> None:
+    def __init__(
+        self,
+        dataset_id: str,
+        table_id: str,
+        table_resource: Optional[Dict[str, Any]] = None,

Review comment:
       Hint: ``@apply_defaults``




----------------------------------------------------------------
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:
users@infra.apache.org