Skip to content
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

Fix SFTPSensor when using newer_than and there are multiple matched files #29794

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

hussein-awala
Copy link
Member

closes: #29781


Currently when we provide file_pattern to SFTPSensor, it tries to get the first matched file and return True when it finds one. But it does the same thing when newer_than is provided, so instead of checking if there is at least one file newer than the provided date, it checks if the first matched file is newer than this date.

This PR fixes this bug by getting all the matched files, and returning True when there is at least one file newer than the provided date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

newer_than and file_pattern don't work well together in SFTPSensor
2 participants