Merge branch 'feature/QUANT-2992' into feature/QUANT-2993

This commit is contained in:
brmnjsh 2023-09-11 13:23:24 +00:00
commit f22d1c4cdb

View File

@ -31,13 +31,7 @@ def get_object(key: str, bucket: str) -> bytes:
def get_object_tag(key: str, bucket: str, tag_key: str) -> Union[str, None]:
tags = get_object_tags(key, bucket)
for i, tag in enumerate(tags):
tag = tags[i]
if tag['Key'] == tag_key:
return tag
else:
return None
return next((tag for tag in tags if tag['Key'] == tag_key), None)
def get_object_tags(key: str, bucket: str) -> list:
tags = s3.get_object_tagging(Bucket=bucket, Key=key)['TagSet']