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

 ##########
 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:
   thanks for review. working on it.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to