You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by cr...@apache.org on 2017/09/14 21:35:51 UTC

[1/2] incubator-airflow git commit: [AIRFLOW-1613] Make MySqlToGoogleCloudStorageOperator compaitible with python3

Repository: incubator-airflow
Updated Branches:
  refs/heads/v1-9-test f1f9b4a2e -> 99cd3c12d


[AIRFLOW-1613] Make MySqlToGoogleCloudStorageOperator compaitible with python3

Closes #2609 from jgao54/make-MySqlToGoogleCloudStorageOperator-python3-compaitible


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

Branch: refs/heads/v1-9-test
Commit: e415c1aabccece455b7568174c53173097b6a5b8
Parents: bd377fb
Author: Joy Gao <jo...@wepay.com>
Authored: Thu Sep 14 14:33:59 2017 -0700
Committer: Chris Riccomini <cr...@apache.org>
Committed: Thu Sep 14 14:35:27 2017 -0700

----------------------------------------------------------------------
 airflow/contrib/operators/mysql_to_gcs.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/e415c1aa/airflow/contrib/operators/mysql_to_gcs.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/mysql_to_gcs.py b/airflow/contrib/operators/mysql_to_gcs.py
index 7e83bce..f7b3a5a 100644
--- a/airflow/contrib/operators/mysql_to_gcs.py
+++ b/airflow/contrib/operators/mysql_to_gcs.py
@@ -120,9 +120,9 @@ class MySqlToGoogleCloudStorageOperator(BaseOperator):
             names in GCS, and values are file handles to local files that
             contain the data for the GCS objects.
         """
-        schema = map(lambda schema_tuple: schema_tuple[0], cursor.description)
+        schema = list(map(lambda schema_tuple: schema_tuple[0], cursor.description))
         file_no = 0
-        tmp_file_handle = NamedTemporaryFile(delete=True)
+        tmp_file_handle = NamedTemporaryFile(mode='w', delete=True)
         tmp_file_handles = {self.filename.format(file_no): tmp_file_handle}
 
         for row in cursor:
@@ -139,7 +139,7 @@ class MySqlToGoogleCloudStorageOperator(BaseOperator):
             # Stop if the file exceeds the file size limit.
             if tmp_file_handle.tell() >= self.approx_max_file_size_bytes:
                 file_no += 1
-                tmp_file_handle = NamedTemporaryFile(delete=True)
+                tmp_file_handle = NamedTemporaryFile(mode='w', delete=True)
                 tmp_file_handles[self.filename.format(file_no)] = tmp_file_handle
 
         return tmp_file_handles
@@ -169,7 +169,7 @@ class MySqlToGoogleCloudStorageOperator(BaseOperator):
             })
 
         self.logger.info('Using schema for %s: %s', self.schema_filename, schema)
-        tmp_schema_file_handle = NamedTemporaryFile(delete=True)
+        tmp_schema_file_handle = NamedTemporaryFile(mode='w', delete=True)
         json.dump(schema, tmp_schema_file_handle)
         return {self.schema_filename: tmp_schema_file_handle}
 


[2/2] incubator-airflow git commit: Merge branch 'v1-9-test' of https://git-wip-us.apache.org/repos/asf/incubator-airflow into v1-9-test

Posted by cr...@apache.org.
Merge branch 'v1-9-test' of https://git-wip-us.apache.org/repos/asf/incubator-airflow into v1-9-test


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

Branch: refs/heads/v1-9-test
Commit: 99cd3c12d54fca3d69120ad3e8e73e4f2bc95824
Parents: e415c1a f1f9b4a
Author: Chris Riccomini <cr...@apache.org>
Authored: Thu Sep 14 14:35:41 2017 -0700
Committer: Chris Riccomini <cr...@apache.org>
Committed: Thu Sep 14 14:35:41 2017 -0700

----------------------------------------------------------------------
 .gitignore                                   | 4 ++--
 airflow/config_templates/default_airflow.cfg | 4 ++++
 airflow/config_templates/default_test.cfg    | 1 +
 airflow/utils/helpers.py                     | 3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------