You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/02 00:52:37 UTC

[GitHub] [airflow] jhtimmins commented on a change in pull request #15134: add loggin.info when poke in SFTP,FTP and Filesystem sensor to show last modified

jhtimmins commented on a change in pull request #15134:
URL: https://github.com/apache/airflow/pull/15134#discussion_r606019412



##########
File path: airflow/sensors/filesystem.py
##########
@@ -57,6 +58,9 @@ def poke(self, context):
 
         for path in glob(full_path):
             if os.path.isfile(path):
+                mod_time = os.path.getmtime(path)
+                mod_time = datetime.fromtimestamp(mod_time).strftime('%Y%m%d%H%M%S')
+                self.log.info(f'Found File {full_path} last modified: {mod_time}')

Review comment:
       Since the logging takes place inside the loop, this should probably log `path`
   ```suggestion
                   self.log.info(f'Found File {path} last modified: {mod_time}')
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org