subkanthi commented on a change in pull request #20590:
URL: https://github.com/apache/airflow/pull/20590#discussion_r776923548



##########
File path: airflow/providers/amazon/aws/transfers/ftp_to_s3.py
##########
@@ -132,12 +132,13 @@ def execute(self, context: 'Context'):
                 if self.ftp_filenames == '*':
                     files = list_dir
                 else:
-                    files = list(filter(lambda file: self.ftp_filenames in 
file, list_dir))
+                    ftp_filename: str = self.ftp_filenames
+                    files = list(filter(lambda f: ftp_filename in f, list_dir))

Review comment:
       Sorry confused, are you referring to moving this line
   `ftp_filename: str = self.ftp_filenames`
   
   ```        if self.ftp_filenames:
               if isinstance(self.ftp_filenames, str):
                   ftp_filename: str = self.ftp_filenames
                   self.log.info(f'Getting files in {self.ftp_path}')
                   list_dir = self.ftp_hook.list_directory(
                       path=self.ftp_path,
                   )
   
                   if self.ftp_filenames == '*':
                       files = list_dir
                   else:
                       files = list(filter(lambda f: ftp_filename in f, 
list_dir))
   
                   for file in files:
                       self.log.info(f'Moving file {file}')
   
                       if self.s3_filenames and isinstance(self.s3_filenames, 
str):
                           filename = file.replace(self.ftp_filenames, 
self.s3_filenames)```




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