Adaverse commented on code in PR #47533:
URL: https://github.com/apache/airflow/pull/47533#discussion_r1986185947
##########
providers/sftp/src/airflow/providers/sftp/operators/sftp.py:
##########
@@ -171,9 +185,17 @@ def execute(self, context: Any) -> str | list[str] | None:
file_msg = f"from {_local_filepath} to
{_remote_filepath}"
self.log.info("Starting to transfer file %s", file_msg)
if os.path.isdir(_local_filepath):
- self.sftp_hook.store_directory(
- _remote_filepath, _local_filepath,
confirm=self.confirm
- )
+ if self.concurrency > 1:
+ self.sftp_hook.store_directory_concurrently(
+ _remote_filepath,
+ _local_filepath,
+ confirm=self.confirm,
+ workers=self.concurrency,
+ )
+ elif self.concurrency == 1:
Review Comment:
How about extending this feature to allow users to pass multiple different
files at once as well?
--
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]