-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SftpSensor w/ possibility to use RegEx or fnmatch #15332
Comments
You can use the wildcard in SFTPSensor |
Hey @blcksrx would you mind giving some more details on how to use them? If I simply use the wildcard written above with Airflow's built-in SFTPSensor, it doesn't capture anything.. |
it sounds for *nix OS that provides shell. it's convenient to use wildcards like this:
but it is too raw and not useable for any cases. I'm going to prepare a PR for that to using regex. |
Description
SmartSftpSensor with possibility to search for patterns (RegEx or UNIX fnmatch) in filenames or folders
Use case / motivation
I would like to have the possibility to use wildcards and/or regular expressions to look for certain files when using an SftpSensor.
At the moment I tried to do something like this:
And I call it by doing
where path is the folder containing the files and filepattern is a rendered filename with wildcards:
filename = """{{ execution_date.strftime("%y%m%d_%H00??_P??_???") }}.LV1"""
, which is rendered to e.g.210412_1600??_P??_???.LV1
but I am still not getting the expected result, as it's not capturing anything.
Are you willing to submit a PR?
Yes!
Related Issues
I didn't find any
The text was updated successfully, but these errors were encountered: