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 2019/09/30 14:00:40 UTC

[GitHub] [airflow] mohannadbanayosi commented on a change in pull request #6180: [AIRFLOW-5549] Extended BQ GetDataOperator to handle query params

mohannadbanayosi commented on a change in pull request #6180: [AIRFLOW-5549] Extended BQ GetDataOperator to handle query params
URL: https://github.com/apache/airflow/pull/6180#discussion_r329592909
 
 

 ##########
 File path: airflow/gcp/operators/bigquery.py
 ##########
 @@ -285,37 +299,45 @@ def __init__(self,
 
         self.dataset_id = dataset_id
         self.table_id = table_id
+        self.start_index = start_index
         self.max_results = max_results
+        self.page_token = page_token
         self.selected_fields = selected_fields
         self.gcp_conn_id = gcp_conn_id
         self.delegate_to = delegate_to
-        self.location = location
 
     def execute(self, context):
         self.log.info('Fetching Data from:')
         self.log.info('Dataset: %s ; Table: %s ; Max Results: %s',
                       self.dataset_id, self.table_id, self.max_results)
 
         hook = BigQueryHook(bigquery_conn_id=self.gcp_conn_id,
-                            delegate_to=self.delegate_to,
-                            location=self.location)
+                            delegate_to=self.delegate_to)
 
         conn = hook.get_conn()
         cursor = conn.cursor()
         response = cursor.get_tabledata(dataset_id=self.dataset_id,
                                         table_id=self.table_id,
+                                        start_index=self.start_index,
                                         max_results=self.max_results,
+                                        page_token=self.page_token,
                                         selected_fields=self.selected_fields)
 
         self.log.info('Total Extracted rows: %s', response['totalRows'])
         rows = response['rows']
 
-        table_data = []
+        table_rows = []
 
 Review comment:
   I prefer this too, but didn't want to change it for readability.

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


With regards,
Apache Git Services