You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2016/08/21 18:32:54 UTC

incubator-airflow git commit: [AIRFLOW-447] Store source URIs in Python 3 compatible list

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 3cba29e02 -> fe037d6d6


[AIRFLOW-447] Store source URIs in Python 3 compatible list

In Python 2 map would generate a list, in Python 3
this is no longer true.
Downstream a job with source_uris set to a Python
3 map object cannot be json-serialized
when attempting to store the job in the database.

This fix keeps the source_uris in a json-
serializable list in both Python 2 and 3.

Closes #1754 from
waltherg/fix/python3_map_incompatibility


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/fe037d6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/fe037d6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/fe037d6d

Branch: refs/heads/master
Commit: fe037d6d627934568b7f9a3022dcbe70455799e1
Parents: 3cba29e
Author: Georg Walther <ge...@gmail.com>
Authored: Sun Aug 21 20:32:24 2016 +0200
Committer: Bolke de Bruin <bo...@xs4all.nl>
Committed: Sun Aug 21 20:32:31 2016 +0200

----------------------------------------------------------------------
 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/fe037d6d/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 8a21de6..f64ae6c 100644
--- a/airflow/contrib/operators/gcs_to_bq.py
+++ b/airflow/contrib/operators/gcs_to_bq.py
@@ -121,7 +121,7 @@ class GoogleCloudStorageToBigQueryOperator(BaseOperator):
                                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))
-        source_uris = map(lambda schema_object: 'gs://{}/{}'.format(self.bucket, schema_object), self.source_objects)
+        source_uris = ['gs://{}/{}'.format(self.bucket, schema_object) for schema_object in self.source_objects]
         conn = bq_hook.get_conn()
         cursor = conn.cursor()
         cursor.run_load(