nuclearpinguin 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_r333513879
##########
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,
Review comment:
My idea was to keep this method stateless. Part of the reason was the fact
it's used in `provide_gcp_credentials_from_service_key` which is also a static
method.
----------------------------------------------------------------
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