Exemplo n.º 1
0
    def test_get_target_path(self):
        bq_target = bigquery.BigQueryTarget("p",
                                            "d",
                                            "t",
                                            client="fake_client")
        self.assertEqual(SimpleTestTask.get_target_path(bq_target), "p:d.t")

        gcs_target = gcs.GCSTarget("gs://foo/bar.txt", client="fake_client")
        self.assertEqual(SimpleTestTask.get_target_path(gcs_target),
                         "gs://foo/bar.txt")

        with self.assertRaises(ValueError):
            SimpleTestTask.get_target_path("not_a_target")
Exemplo n.º 2
0
 def output(self):
     return bigquery.BigQueryTarget(PROJECT_ID,
                                    DATASET_ID,
                                    self.table,
                                    client=self.client)
Exemplo n.º 3
0
 def output(self):
     return bigquery.BigQueryTarget(PROJECT_ID,
                                    self.dataset,
                                    self.table,
                                    location=self.location)
Exemplo n.º 4
0
 def output(_):
     return bigquery.BigQueryTarget(PROJECT_ID, DATASET_ID,
                                    self.table_id)
Exemplo n.º 5
0
 def output(_):
     return bigquery.BigQueryTarget(PROJECT_ID,
                                    DATASET_ID,
                                    self.table_id,
                                    location=EU_LOCATION)
Exemplo n.º 6
0
 def output(self):
     return bigquery.BigQueryTarget(project_id, dataset_id, 'rich_fines')
Exemplo n.º 7
0
 def output(self):
     return bigquery.BigQueryTarget(self.project, self.dataset, self.table, client=self.client)