ellisms commented on code in PR #39950:
URL: https://github.com/apache/airflow/pull/39950#discussion_r1621319284
##########
airflow/providers/amazon/aws/sensors/s3.py:
##########
@@ -123,8 +129,25 @@ def _check_key(self, key):
if not key_matches:
return False
- # Reduce the set of metadata to size only
- files = [{"Size": f["Size"]} for f in key_matches]
+ # Reduce the set of metadata to requested attributes
+ files = []
+ for f in key_matches:
+ metadata = {}
+ if "*" in self.metadata_keys:
+ metadata = self.hook.head_object(f["Key"], bucket_name)
+ else:
+ for key in self.metadata_keys:
+ # backwards compatibility with original implementation
+ if key == "Size":
+ metadata[key] = f.get("ContentLength")
Review Comment:
Yeah, I think you are right. I'll remove it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]