You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/01 21:36:00 UTC

[jira] [Commented] (AIRFLOW-3396) Redundant sql param check in BigQueryOperator

    [ https://issues.apache.org/jira/browse/AIRFLOW-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16706013#comment-16706013 ] 

ASF GitHub Bot commented on AIRFLOW-3396:
-----------------------------------------

kaxil closed pull request #4224: [AIRFLOW-3396] Make sql param as required in BigQueryOperator
URL: https://github.com/apache/incubator-airflow/pull/4224
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/contrib/operators/bigquery_operator.py b/airflow/contrib/operators/bigquery_operator.py
index 735c7583ae..7ce3102ad2 100644
--- a/airflow/contrib/operators/bigquery_operator.py
+++ b/airflow/contrib/operators/bigquery_operator.py
@@ -105,7 +105,7 @@ class BigQueryOperator(BaseOperator):
 
     @apply_defaults
     def __init__(self,
-                 sql=None,
+                 sql,
                  destination_dataset_table=False,
                  write_disposition='WRITE_EMPTY',
                  allow_large_results=False,
@@ -150,10 +150,6 @@ def __init__(self,
             self.api_resource_configs = {}
         self.cluster_fields = cluster_fields
 
-        if self.sql is None:
-            raise TypeError('{} missing 1 required positional '
-                            'argument: `sql`'.format(self.task_id))
-
     def execute(self, context):
         if self.bq_cursor is None:
             self.log.info('Executing: %s', self.sql)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> Redundant sql param check in BigQueryOperator
> ---------------------------------------------
>
>                 Key: AIRFLOW-3396
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3396
>             Project: Apache Airflow
>          Issue Type: Task
>          Components: gcp
>            Reporter: Kaxil Naik
>            Assignee: Kaxil Naik
>            Priority: Trivial
>             Fix For: 2.0.0
>
>
> The 'sql' parameter in BigQueryOperator accepts None and then there is a check which checks if it is None and gives error.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)