[AIRFLOW-3416] Fixes Python 3 compatibility with CloudSqlQueryOperator #4254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make sure you have checked all steps below.
Jira
Description
Added several missing decodes on reading output from running
subprocess (cloud_sql_proxy). This fixes Python3 compatibility.
Tests
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
Documentation
No new functionality.
Code Quality
flake8