You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/03/25 14:19:29 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #7869: [AIRFLOW-5801] Get GCP credentials from file instead of JSON blob

ephraimbuddy commented on a change in pull request #7869: [AIRFLOW-5801] Get GCP credentials from file instead of JSON blob
URL: https://github.com/apache/airflow/pull/7869#discussion_r397890186
 
 

 ##########
 File path: airflow/providers/google/cloud/hooks/cloud_sql.py
 ##########
 @@ -520,12 +520,12 @@ def _get_credential_parameters(self, session: Session) -> List[str]:
         connection = session.query(Connection). \
             filter(Connection.conn_id == self.gcp_conn_id).first()
         session.expunge_all()
-        if GCP_CREDENTIALS_KEY_PATH in connection.extra_dejson:
+        if connection.extra_dejson.get(GCP_CREDENTIALS_KEY_PATH):
             credential_params = [
                 '-credential_file',
                 connection.extra_dejson[GCP_CREDENTIALS_KEY_PATH]
             ]
-        elif GCP_CREDENTIALS_KEYFILE_DICT in connection.extra_dejson:
+        elif connection.extra_dejson.get(GCP_CREDENTIALS_KEYFILE_DICT):
 
 Review comment:
   I was trying to resolve this issue https://issues.apache.org/jira/browse/AIRFLOW-5801.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services