Guaqamole commented on code in PR #44320:
URL: https://github.com/apache/airflow/pull/44320#discussion_r1860936101


##########
providers/src/airflow/providers/amazon/aws/transfers/sftp_to_s3.py:
##########
@@ -85,6 +89,14 @@ def execute(self, context: Context) -> None:
 
         sftp_client = ssh_hook.get_conn().open_sftp()
 
+        try:
+            sftp_client.stat(self.sftp_path)
+        except FileNotFoundError:
+            if self.fail_on_file_not_exist:
+                raise
+            self.log.info("File %s not found on SFTP server. Skipping 
transfer.", self.sftp_path)
+            return

Review Comment:
   I also agree with your point. It would be better if paramiko had 
functionality to check file existence without raising errors, but using 
sftp_client.stat() was my best.
   
   So am I eligible to resolve this? Or someone else is approving? (I'm not 
familiar with this process😅 its my first PR)



-- 
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]

Reply via email to