[ https://issues.apache.org/jira/browse/AIRFLOW-1613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16166997#comment-16166997 ]
ASF subversion and git services commented on AIRFLOW-1613: ---------------------------------------------------------- Commit e415c1aabccece455b7568174c53173097b6a5b8 in incubator-airflow's branch refs/heads/v1-9-test from [~joy.gao54] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=e415c1a ] [AIRFLOW-1613] Make MySqlToGoogleCloudStorageOperator compaitible with python3 Closes #2609 from jgao54/make-MySqlToGoogleCloudStorageOperator-python3-compaitible > Make MySqlToGoogleCloudStorageOperator compaitible with python3 > --------------------------------------------------------------- > > Key: AIRFLOW-1613 > URL: https://issues.apache.org/jira/browse/AIRFLOW-1613 > Project: Apache Airflow > Issue Type: Bug > Components: contrib > Reporter: Joy Gao > > 1. > In Python 3, map(...) returns an iterator, which can only be iterated over > once. > Therefore the current implementation will return an empty list after the > first iteration of schema: > {code} > schema = map(lambda schema_tuple: schema_tuple[0], cursor.description) > file_no = 0 > tmp_file_handle = NamedTemporaryFile(delete=True) > tmp_file_handles = {self.filename.format(file_no): tmp_file_handle} > for row in cursor: > # Convert datetime objects to utc seconds, and decimals to floats > row = map(self.convert_types, row) > row_dict = dict(zip(schema, row)) > {code} > 2. > File opened as binary, but string are written to it. Get error `a bytes-like > object is required, not 'str'`. Use mode='w' instead. -- This message was sent by Atlassian JIRA (v6.4.14#64029)