Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9E20D200D18 for ; Wed, 11 Oct 2017 22:07:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9CC621609E5; Wed, 11 Oct 2017 20:07:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E1F5F1609BB for ; Wed, 11 Oct 2017 22:07:04 +0200 (CEST) Received: (qmail 11028 invoked by uid 500); 11 Oct 2017 20:07:04 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 11019 invoked by uid 99); 11 Oct 2017 20:07:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2017 20:07:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 33D8A184623 for ; Wed, 11 Oct 2017 20:07:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.702 X-Spam-Level: X-Spam-Status: No, score=-98.702 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id uEcr4PhEQ1kO for ; Wed, 11 Oct 2017 20:07:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id F0C1160FA3 for ; Wed, 11 Oct 2017 20:07:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2D017E09A5 for ; Wed, 11 Oct 2017 20:07:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 53587253A2 for ; Wed, 11 Oct 2017 20:07:00 +0000 (UTC) Date: Wed, 11 Oct 2017 20:07:00 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-1613) Make MySqlToGoogleCloudStorageOperator compaitible with python3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 11 Oct 2017 20:07:05 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-1613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200871#comment-16200871 ] ASF subversion and git services commented on AIRFLOW-1613: ---------------------------------------------------------- Commit d578b292e96d5fdd87b5168508005cd73edc4f96 in incubator-airflow's branch refs/heads/master from [~joy.gao54] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=d578b29 ] [AIRFLOW-1613] Handle binary field in MySqlToGoogleCloudStorageOperator Closes #2680 from jgao54/write-binary > 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)