Repository: incubator-airflow Updated Branches: refs/heads/master f8185f9d8 -> e4cca0de2
[AIRFLOW-583] Fix decode error in gcs_to_bq Closes #1845 from Jalepeno112/bug/schema_object_decode_error Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/e4cca0de Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/e4cca0de Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/e4cca0de Branch: refs/heads/master Commit: e4cca0de2cb6a69fa46107f085554611cf2c405c Parents: f8185f9 Author: Giovanni Briggs <gbriggs2...@gmail.com> Authored: Fri Oct 21 09:08:41 2016 -0700 Committer: Chris Riccomini <chr...@wepay.com> Committed: Fri Oct 21 09:08:41 2016 -0700 ---------------------------------------------------------------------- airflow/contrib/operators/gcs_to_bq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/e4cca0de/airflow/contrib/operators/gcs_to_bq.py ---------------------------------------------------------------------- diff --git a/airflow/contrib/operators/gcs_to_bq.py b/airflow/contrib/operators/gcs_to_bq.py index f64ae6c..25b338d 100644 --- a/airflow/contrib/operators/gcs_to_bq.py +++ b/airflow/contrib/operators/gcs_to_bq.py @@ -120,7 +120,7 @@ class GoogleCloudStorageToBigQueryOperator(BaseOperator): bq_hook = BigQueryHook(bigquery_conn_id=self.bigquery_conn_id, delegate_to=self.delegate_to) - schema_fields = self.schema_fields if self.schema_fields else json.loads(gcs_hook.download(self.bucket, self.schema_object)) + schema_fields = self.schema_fields if self.schema_fields else json.loads(gcs_hook.download(self.bucket, self.schema_object).decode("utf-8")) source_uris = ['gs://{}/{}'.format(self.bucket, schema_object) for schema_object in self.source_objects] conn = bq_hook.get_conn() cursor = conn.cursor()