def _copy_table(self, write_disposition): self.connections.table_ref = self._table_ref source = BigQueryRelation.create(database='project', schema='dataset', identifier='table1') destination = BigQueryRelation.create(database='project', schema='dataset', identifier='table2') self.connections.copy_bq_table(source, destination, write_disposition)
def test_create_schema(self): relation = BigQueryRelation.create(database='db', schema='schema') self.adapter.create_schema(relation) self.mock_connection_manager.create_dataset.assert_called_once_with( 'db', 'schema')
def test_drop_schema(self, mock_check_schema): mock_check_schema.return_value = True relation = BigQueryRelation.create(database='db', schema='schema') self.adapter.drop_schema(relation) self.mock_connection_manager.drop_dataset.assert_called_once_with( 'db', 'schema')
def _stub_relation(*args, **kwargs): return BigQueryRelation.create(database='', schema='', identifier='', quote_policy={}, type=BigQueryRelation.Table)