sunildataengineer commented on code in PR #65480:
URL: https://github.com/apache/airflow/pull/65480#discussion_r3291406527
##########
providers/sftp/src/airflow/providers/sftp/operators/sftp.py:
##########
@@ -108,8 +105,25 @@ def __init__(
self.remote_filepath = remote_filepath
self.concurrency = concurrency
self.prefetch = prefetch
+ self.deferrable = deferrable
def execute(self, context: Any) -> str | list[str] | None:
+ if self.deferrable:
+ self.defer(
+ trigger=SFTPOperatorTrigger(
+ ssh_conn_id=self.ssh_conn_id,
+ local_filepath=self.local_filepath,
+ remote_filepath=self.remote_filepath,
+ operation=self.operation,
+ confirm=self.confirm,
+ create_intermediate_dirs=self.create_intermediate_dirs,
+ remote_host=self.remote_host,
+ concurrency=self.concurrency,
+ prefetch=self.prefetch,
+ ),
+ method_name="execute_complete",
+ )
+
if self.local_filepath is None:
Review Comment:
Good catch @dabla — you're right, `SFTPOperator.execute()` is not calling
`SFTPHook.transfer()` yet. That was the whole point of the refactoring. Will
fix it now so the operator fully delegates to the hook, and same for the
trigger delegating to `SFTPHookAsync.transfer()`. Push incoming shortly.
--
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]