You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "phanikumv (via GitHub)" <gi...@apache.org> on 2024/09/26 05:04:07 UTC
Re: [PR] fix(providers/common/sql): add dummy connection setter for backward compatibility [airflow]
phanikumv commented on code in PR #42490:
URL: https://github.com/apache/airflow/pull/42490#discussion_r1776358035
##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -210,6 +210,17 @@ def connection(self) -> Connection:
self._connection = self.get_connection(self.get_conn_id())
return self._connection
+ @connection.setter
+ def connection(self, value: Any) -> None:
+ # This dummpy setter is for backward compatibility and should not be used.
Review Comment:
```suggestion
# This dummy setter is for backward compatibility and should not be used.
```
##########
tests/providers/mysql/hooks/test_mysql.py:
##########
@@ -67,6 +67,21 @@ def test_get_conn(self, mock_connect):
assert kwargs["host"] == "host"
assert kwargs["db"] == "schema"
+ @mock.patch("MySQLdb.connect")
+ def test_dummpy_connection_setter(self, mock_connect):
Review Comment:
```suggestion
def test_dummy_connection_setter(self, mock_connect):
```
--
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