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 2019/10/10 11:55:50 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #6299: [AIRFLOW-5631] Change way of running GCP system tests

mik-laj commented on a change in pull request #6299: [AIRFLOW-5631] Change way of running GCP system tests
URL: https://github.com/apache/airflow/pull/6299#discussion_r333476751
 
 

 ##########
 File path: airflow/gcp/hooks/base.py
 ##########
 @@ -323,8 +341,63 @@ def provide_gcp_credential_file_as_context(self):
                     pass
                 yield conf_file
             finally:
-                if current_env_state is None:
-                    if CREDENTIALS in os.environ:
-                        del os.environ[CREDENTIALS]
-                else:
-                    os.environ[CREDENTIALS] = current_env_state
+                self.restore_env_variable(current_env_state)
+
+    @staticmethod
+    def build_gcp_conn(
+        key_file_path: Optional[str] = None,
+        scopes: Optional[Sequence[str]] = None,
+        project_id: Optional[str] = None,
+        gcp_conn_id: str = 'google_cloud_default'
+    ) -> str:
+        """
+        Builds a variable that can be used as `AIRFLOW_CONN_GOOGLE_CLOUD_DEFAULT` with provided service key,
+        scopes and project id.
+        """
+        conn = "google-cloud-platform://?"
+        extras = "extra__{}".format(gcp_conn_id)
 
 Review comment:
   It's will probable doesn't work. This contents is related to UI.

----------------------------------------------------------------
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