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
Add use_regex param in S3KeySensor #1172
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1172 +/- ##
=======================================
Coverage 98.58% 98.59%
=======================================
Files 90 90
Lines 5387 5395 +8
=======================================
+ Hits 5311 5319 +8
Misses 76 76
☔ View full report in Codecov by Sentry. |
cc1860b
to
1d704a1
Compare
1d704a1
to
b352432
Compare
for more information, see https://pre-commit.ci
""" | ||
bucket_name, key = S3Hook.get_s3_bucket_key(bucket_val, key, "bucket_name", "bucket_key") | ||
if wildcard_match: | ||
keys = await self.get_file_metadata(client, bucket_name, key) | ||
key_matches = [k for k in keys if fnmatch.fnmatch(k["Key"], key)] | ||
if len(key_matches) == 0: | ||
return False | ||
elif use_regex: | ||
keys = await self.get_file_metadata(client, bucket_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Third parameter key
(optional) is missing. Was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, listing objects from s3 does not work well with regex search. We are using the key get_file_metadata
for prefix search.
closes: #1154