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/01/12 11:27:32 UTC

[GitHub] kaxil commented on a change in pull request #4448: WIP [AIRFLOW-3601] add location support to BigQuery operators

kaxil commented on a change in pull request #4448: WIP [AIRFLOW-3601] add location support to BigQuery operators
URL: https://github.com/apache/airflow/pull/4448#discussion_r247310250
 
 

 ##########
 File path: tests/contrib/hooks/test_bigquery_hook.py
 ##########
 @@ -380,6 +428,24 @@ def test_create_view(self):
         }
         method.assert_called_once_with(projectId=project_id, datasetId=dataset_id, body=body)
 
+    def test_create_empty_table_with_location(self):
+        project_id = 'bq-project'
+        dataset_id = 'bq_dataset'
+        table_id = 'bq_table_location'
+        location = 'asia-northeast1'
+
+        mock_service = mock.Mock()
+        method = mock_service.tables.return_value.insert
+        cursor = hook.BigQueryBaseCursor(mock_service, project_id, location=location)
+        cursor.create_empty_table(project_id, dataset_id, table_id)
+        body = {
+            'tableReference': {
+                'tableId': table_id
+            },
+            'location': location
+        }
+        method.assert_called_once_with(projectId=project_id, datasetId=dataset_id, body=body)
+
 
 Review comment:
   Can you add tests for BigQuery Check Operators and the other operators where you added the location

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


With regards,
Apache Git Services