creyesp opened a new pull request #5478: [AIRFLOW-4849] Add gcp_conn_id to 
cloudsqldatabehook class to use correctly CloudSqlProxyRunner class
URL: https://github.com/apache/airflow/pull/5478
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW-4849) 
   
   ### Description
   
   - [ ] CloudSqlQueryOperator() class has gcp_conn_id,  gcp_cloudsql_conn_id 
attributes and a object attribute of the CloudSqlDatabaseHook class to manage 
cloud_sql_proxy but CloudSqlDatabaseHook doesn't passing gcp_conn_id as 
argument, only use gcp_cloudsql_conn_id. So when the  get_sqlproxy_runner() 
method in CloudSqlDatabaseHook call CloudSqlProxyRunner() class, 
CloudSqlProxyRunner try to get gcp credential from gcp_cloudsql_conn_id but it 
hasn't credential parameter and Airflow send the following message:
    
   `[2019-06-25 09:31:55,381] {logging_mixin.py:95} INFO - [2019-06-25 
09:31:55,381] {gcp_sql_hook.py:508} INFO - The credentials are not supplied by 
neither key_path nor keyfile_dict of the gcp connection 
google_cloud_proxy_conn_XXX. Falling back to default activated account`
   
   This fix add gcp_coon_id attribute to CloudSqlDatabaseHook class, change 
parameter passed to CloudSqlProxyRunner from gcp_cloudsql_conn_id to 
gcp_conn_id and add gcp_conn_id parameter to CloudSqlDatabaseHook when it is 
called from CloudSqlQueryOperator
   
   There was other issue about the problem 
(https://issues.apache.org/jira/browse/AIRFLOW-4557?jql=text%20~%20%22AIRFLOW-4557%22)
 but the solution was not resolve the error because CloudSqlProxyRunner() need 
a google cloud platform connection not a google cloud sql connection.
   
   
   ### Tests
   
   - [ ] My PR adds modification on the following unit tests :
   
   - test_gcp_sql_hook.test_get_sqlproxy_runner()
   
   ### Commits
   
   - [ ] 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
   
   - [ ] No new functionality, fixing a bug
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to