rawwar commented on code in PR #38871:
URL: https://github.com/apache/airflow/pull/38871#discussion_r1559057020
##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -207,6 +219,24 @@ def get_uri(self) -> str:
conn.schema = self.__schema or conn.schema
return conn.get_uri()
+ def get_sqlalchemy_url(self) -> URL:
+ """
+ Return a Sqlalchemy.engine.URL object from the connection.
+
+ :return: the extracted sqlalchemy.engine.URL object.
+ """
+ conn = self.get_connection(getattr(self, self.conn_name_attr))
+ conn.schema = self.__schema or conn.schema
+ conn.port = conn.port or 5432
+ return URL.create(
+ drivername=self.drivername,
+ username=conn.login,
+ password=conn.password,
+ host=conn.host,
+ port=conn.port,
+ database=conn.schema,
+ )
Review Comment:
I understand. I've updated the PR to not have any implementation so that
this kind of custom implementations can be done in the providers.
--
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]