From 02f319ea5a236bad114d08d1cac58f58240f6bb0 Mon Sep 17 00:00:00 2001 From: Shantanu Singh Date: Sat, 8 Apr 2023 10:06:58 -0400 Subject: [PATCH 1/2] bug fix --- pycytominer/cyto_utils/cell_locations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycytominer/cyto_utils/cell_locations.py b/pycytominer/cyto_utils/cell_locations.py index 755ab7a3..f2ccd625 100644 --- a/pycytominer/cyto_utils/cell_locations.py +++ b/pycytominer/cyto_utils/cell_locations.py @@ -147,7 +147,7 @@ def _s3_file_exists(self, s3_path: str): bucket, key = self._parse_s3_path(s3_path) try: - self.s3.Object(bucket, key).load() + self.s3.head_object(Bucket=bucket, Key=key) except botocore.exceptions.ClientError as e: if e.response["Error"]["Code"] == "404": return False From 708c50054d4f5c190334d6269245358402ec3bc3 Mon Sep 17 00:00:00 2001 From: Shantanu Singh Date: Mon, 17 Apr 2023 05:38:40 -0400 Subject: [PATCH 2/2] fixes --- pycytominer/cyto_utils/cell_locations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycytominer/cyto_utils/cell_locations.py b/pycytominer/cyto_utils/cell_locations.py index f2ccd625..0f4b8ed0 100644 --- a/pycytominer/cyto_utils/cell_locations.py +++ b/pycytominer/cyto_utils/cell_locations.py @@ -149,7 +149,7 @@ def _s3_file_exists(self, s3_path: str): try: self.s3.head_object(Bucket=bucket, Key=key) except botocore.exceptions.ClientError as e: - if e.response["Error"]["Code"] == "404": + if e.response["Error"]["Code"] in ["404", "400", "403"]: return False else: raise