filesensor wildcard matching does not recognize directories
See original GitHub issueApache Airflow version: 2.1.0
Environment:
- Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a
): - Install tools:
- Others:
What happened: FileSensor does not recognize directories with wildcard glob matching.
What you expected to happen: FileSensor would sense a directory that contains files if it matches with the wild card option.
How to reproduce it: Create a directory with a pattern that matches a wild card using glob
Anything else we need to know: Code from FileSensor source that I believe to cause the issue:
for path in glob(full_path):
if os.path.isfile(path):
mod_time = os.path.getmtime(path)
mod_time = datetime.datetime.fromtimestamp(mod_time).strftime('%Y%m%d%H%M%S')
self.log.info('Found File %s last modified: %s', str(path), str(mod_time))
return True
for _, _, files in os.walk(full_path):
if len(files) > 0:
return True
return False
I believe to resolve the issue full_path
in os.walk should be path
instead.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
airflow fileSensor matching with specific file pattern
Since the FileSensor operator uses glob module to match file patterns, you can use a file name pattern or a wildcard to achieve...
Read more >PRTG Manual: File Sensor - Paessler
The File sensor monitors a file located on the local disk on the probe system, parent device, or a file that is accessible...
Read more >Source code for airflow.sensors.s3_key_sensor
S3 being a key/value it does not support folders. The path is just a key a resource. :param bucket_key: The key being waited...
Read more >org.apache.airflow.commits - 2021 July - 5,955 messages - MarkMail
[GitHub] [airflow] ShraddheyaS commented on issue #16725: filesensor wildcard matching does not recognize directories - GitBox.
Read more >Narrowing the focus with analysis scope
Pattern matching with wildcards is not supported. ... in the scanner invocation or in the appropriate configuration file (see Analysis Parameters).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you please assign this to me ?
Running now