[
https://issues.apache.org/jira/browse/AIRFLOW-1613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16204373#comment-16204373
]
Chris Riccomini commented on AIRFLOW-1613:
------------------------------------------
Ended up having to revert this due to the following error:
{noformat}
Try 5 out of 4
Exception:
must be string or buffer, not None
Log: Link
{noformat}
Stack trace indicates mysql_to_gcs.py issue. Apparently some VARCHAR fields
have `binary` flag set in description_flags field. This was unexpected.
> 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
> Assignee: Joy Gao
> Fix For: 1.9.0
>
>
> 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.
> 3.
> Operator currently does not support binary columns in mysql. We should
> support uploading binary columns from mysql to cloud storage as it's a pretty
> common use-case.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)