[ https://issues.apache.org/jira/browse/AIRFLOW-3416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702864#comment-16702864 ]
ASF GitHub Bot commented on AIRFLOW-3416: ----------------------------------------- potiuk opened a new pull request #4254: [AIRFLOW-3416] Fixes Python 3 compatibility with CloudSqlQueryOperator URL: https://github.com/apache/incubator-airflow/pull/4254 Make sure you have checked _all_ steps below. ### Jira - [x] My PR addresses the following [Airflow Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR" - https://issues.apache.org/jira/browse/AIRFLOW-3416 ### Description - [x] Here are some details about my PR, including screenshots of any UI changes: Added several missing decodes on reading output from running subprocess (cloud_sql_proxy). This fixes Python3 compatibility. ### Tests - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason: The problem with testing this issue is that it really needs integration testing level with GCP - something that I proposed in https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-4+Support+for+Integration+Tests and we have a working proof of concept using Cloud Build and our own GCP project (we will soon share it with community to see what they think about) so this problem has been actually detected using our automated integration testing and then fixed and tested in python 3.5 and python 3.6 environment. Here are some results of those tests: Tests succeeding in Python 2.7 but failing on both 3.5 and 3.6: https://storage.googleapis.com/polidea-airflow-builds/944c09c7-fbb5-4ae4-b069-7c2590cd1e7e/index.html Tests succeeding in all 3 environments after adding decodes: https://storage.googleapis.com/polidea-airflow-builds/5843e2a9-f086-448d-bdc3-14646ebb7f5d/index.html ### Commits - [x] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 1. Subject is limited to 50 characters (not including Jira issue reference) 1. Subject does not end with a period 1. Subject uses the imperative mood ("add", not "adding") 1. Body wraps at 72 characters 1. Body explains "what" and "why", not "how" ### Documentation - [x] In case of new functionality, my PR adds documentation that describes how to use it. No new functionality. ### Code Quality - [x] Passes `flake8` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > CloudSqlQueryOperator with sql proxy does not work with Python 3.x > ------------------------------------------------------------------ > > Key: AIRFLOW-3416 > URL: https://issues.apache.org/jira/browse/AIRFLOW-3416 > Project: Apache Airflow > Issue Type: Bug > Components: contrib > Affects Versions: 1.10.1 > Reporter: Jarek Potiuk > Assignee: Jarek Potiuk > Priority: Major > > There are compatibility issues with Python 3.x for CloudSQLoperator. Output > of cloud_sql_proxy binary is parsed and the output in Python3 is bytes rather > than string so several "in"s raise an exception in Python 3. It needs > explicit decode('utf-8') -- This message was sent by Atlassian JIRA (v7.6.3#76005)