Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will solve the issue registered by @RishuGuru in #28121.
It also takes into account the request from @potiuk in #28123 to add/fix the unit tests.
In summary, the SFTP Sensor was not finding the files when the
file_patternargument was used.This was due to an incorrect assumption that the SFTP Hook function
get_file_by_patternwould return the full path, where actually it only returns the file name (corrected in e08a702b508e01c8437e4a45eaa726bb39e4f47f).The unit test that was checking that also made this assumption (corrected in 018f316f96ed5f6361eea59987996454ced73bc7).
Also the unit test
test_file_with_pattern_parameter_callseemed to become redundant, and I removed it (full explanation in faa5a73d5b353a3c2c83a90b5040966158b97979).closes: #28121