Lee-W commented on code in PR #52700:
URL: https://github.com/apache/airflow/pull/52700#discussion_r2238698211
##########
providers/sftp/src/airflow/providers/sftp/hooks/sftp.py:
##########
@@ -45,8 +49,45 @@
from airflow.models.connection import Connection
+exclude_methods = [
+ "__init__",
+ "get_ui_field_behaviour",
+ "get_conn",
+ "close_conn",
+ "get_managed_conn",
+ "get_conn_count",
+] # exclude the methods which are not using the connection, so that we won't
create a
+# connection when not needed, i.e init
-class SFTPHook(SSHHook):
+
+class HandleConnectionManagementMetaclass(type):
Review Comment:
I'm not sure we need/should use a metaclass for this. I probably would
prefer a decorator. would like to know how @uranusjr think?
##########
providers/sftp/src/airflow/providers/sftp/hooks/sftp.py:
##########
@@ -155,7 +201,7 @@ def get_conn_count(self) -> int:
"""Get the number of open connections."""
return self._conn_count
- def describe_directory(self, path: str) -> dict[str, dict[str, str | int |
None]]:
+ def describe_directory(self, path: str) -> dict[Any, dict[str, Any]]:
Review Comment:
Why do we want to change this?
--
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]