MaksYermak commented on code in PR #31925:
URL: https://github.com/apache/airflow/pull/31925#discussion_r1254487358


##########
airflow/providers/google/cloud/hooks/spanner.py:
##########
@@ -70,6 +85,34 @@ def _get_client(self, project_id: str) -> Client:
             )
         return self._client
 
+    def _get_conn_params(self) -> SpannerConnectionParams:
+        """Extract spanner database connection parameters."""
+        extras = self.get_connection(self.gcp_conn_id).extra_dejson
+        project_id = get_field(extras, "project_id") or self.project_id
+        instance_id = get_field(extras, "instance_id")
+        database_id = get_field(extras, "database_id")
+        return SpannerConnectionParams(project_id, instance_id, database_id)
+
+    def get_uri(self) -> str:
+        """Override DbApiHook get_uri method for get_sqlalchemy_engine()."""
+        project_id, instance_id, database_id = self._get_conn_params()
+        if not instance_id or not database_id:

Review Comment:
   @Lee-W thank you for the note I have changed this row.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to