예제 #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")
예제 #2
0
 def output(self):
     return bigquery.BigQueryTarget(PROJECT_ID,
                                    DATASET_ID,
                                    self.table,
                                    client=self.client)
예제 #3
0
 def output(self):
     return bigquery.BigQueryTarget(PROJECT_ID,
                                    self.dataset,
                                    self.table,
                                    location=self.location)
예제 #4
0
 def output(_):
     return bigquery.BigQueryTarget(PROJECT_ID, DATASET_ID,
                                    self.table_id)
예제 #5
0
 def output(_):
     return bigquery.BigQueryTarget(PROJECT_ID,
                                    DATASET_ID,
                                    self.table_id,
                                    location=EU_LOCATION)
예제 #6
0
 def output(self):
     return bigquery.BigQueryTarget(project_id, dataset_id, 'rich_fines')
예제 #7
0
 def output(self):
     return bigquery.BigQueryTarget(self.project, self.dataset, self.table, client=self.client)