Skip to content

Commit

Permalink
fix: return value logic for exists was incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
ebridges committed Sep 6, 2020
1 parent ea45e69 commit f83e40a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mp/io/loader/s3_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def key_exists(key, region=DEFAULT_REGION):
bucket = environ[SOURCE_BUCKET]
s3 = boto3.client('s3', region_name=region)
objs = s3.list_objects_v2(Bucket=bucket, MaxKeys=1, Prefix=key)
return any([w == key for w in objs])
sc = objs.get('ResponseMetadata', {}).get('HTTPStatusCode')
return sc == 200


def download_file_from_s3(key, dest, region=DEFAULT_REGION):
Expand Down

0 comments on commit f83e40a

Please sign in to comment.