potiuk commented on a change in pull request #4500: [AIRFLOW-3681] All GCP
operators have now optional GCP Project ID
URL: https://github.com/apache/airflow/pull/4500#discussion_r247325929
##########
File path: airflow/contrib/hooks/gcp_spanner_hook.py
##########
@@ -55,31 +54,36 @@ def get_client(self, project_id):
self._client = Client(project=project_id,
credentials=self._get_credentials())
return self._client
+ @GoogleCloudBaseHook.fallback_to_default_project_id
def get_instance(self, project_id, instance_id):
- # type: (str, str) -> Optional[Instance]
+ # noinspection LongLine
"""
Gets information about a particular instance.
- :param project_id: The ID of the project which owns the Cloud Spanner
Database.
+ :param project_id: The ID of the GCP project that owns the Cloud
Spanner
+ database. if set to None, default project_id is used from service
account.
:type project_id: str
:param instance_id: The ID of the Cloud Spanner instance.
:type instance_id: str
:return: Representation of a Cloud Spanner Instance. See:
https://googleapis.github.io/google-cloud-python/latest/spanner/instance-api.html#google.cloud.spanner_v1.instance.Instance
:rtype: object
"""
+ # noinspection PyUnresolvedReferences
Review comment:
Done that. The PR for abstract class is in the making :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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