You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "o-nikolas (via GitHub)" <gi...@apache.org> on 2023/06/01 17:03:38 UTC
[GitHub] [airflow] o-nikolas commented on a diff in pull request #31640: Support of wildcard in S3ListOperator and S3ToGCSOperator
o-nikolas commented on code in PR #31640:
URL: https://github.com/apache/airflow/pull/31640#discussion_r1213443596
##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -425,7 +427,10 @@ def _is_in_period(input_date: datetime) -> bool:
:return: a list of matched keys
"""
- prefix = prefix or ""
+ _prefix = prefix or ""
+ wildcard_prefix = _prefix
+ if apply_wildcard and "*" in _prefix:
+ wildcard_prefix = _prefix.split("*", 1)[0]
Review Comment:
Hmm, I'm not sure I grok that. If you don't care at all about what the prefix is and you're just assigning an empty string to `wildcard_prefix` then you can simplify a lot of this logic, no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org