dabla commented on code in PR #65480:
URL: https://github.com/apache/airflow/pull/65480#discussion_r3289030775
##########
providers/sftp/src/airflow/providers/sftp/hooks/sftp.py:
##########
@@ -706,6 +706,75 @@ def get_files_by_pattern(self, path, fnmatch_pattern) ->
list[str]:
return matched_files
+ def transfer(
+ self,
+ operation: str,
+ local_filepath: str | list[str] | None,
+ remote_filepath: str | list[str],
+ confirm: bool = True,
+ create_intermediate_dirs: bool = False,
+ concurrency: int = 1,
+ prefetch: bool = True,
+ ) -> None:
+ """
+ Perform a synchronous SFTP transfer operation (GET, PUT, or DELETE).
+
+ Centralises transfer logic so both the operator and the trigger
+ can delegate to the hook, in line with the DRY principle.
Review Comment:
Just change docstring to this, it is logic that we want to respect DRY
principle, no need to mention it in a docstring of a method:
`Perform an SFTP transfer operation (GET, PUT, or DELETE) via a thread
executor.`
--
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]