You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/12/16 21:41:36 UTC

Re: [PR] Add method from_uri and deprecate uri param in constructor [airflow]

hussein-awala commented on code in PR #35898:
URL: https://github.com/apache/airflow/pull/35898#discussion_r1428936920


##########
airflow/providers/google/cloud/hooks/cloud_sql.py:
##########
@@ -964,7 +964,7 @@ def create_connection(self) -> Connection:
         proxy, TCP, UNIX sockets, SSL.
         """
         uri = self._generate_connection_uri()
-        connection = Connection(conn_id=self.db_conn_id, uri=uri)
+        connection = Connection.from_uri(conn_id=self.db_conn_id, uri=uri)

Review Comment:
   You can check the Airflow version or check if `Connection .__dict__ .get("from_uri")` is not None;  if the check fails, we need to fallback to old way (via constructor). Also we need to add a small todo comment to remove it when min_ariflow_version in the providers is >= your checked version.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org