File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -181,16 +181,11 @@ def _get_inferred_s3_uri(s3_uri, s3_resource_for_config):
181
181
"""Placeholder docstring"""
182
182
parsed_url = urlparse (s3_uri )
183
183
bucket , key_prefix = parsed_url .netloc , parsed_url .path .lstrip ("/" )
184
- try :
185
- s3_bucket = s3_resource_for_config .Bucket (name = bucket )
186
- s3_objects = s3_bucket .objects .filter (Prefix = key_prefix ).all ()
187
- s3_files_with_same_prefix = [
188
- "{}{}/{}" .format (S3_PREFIX , bucket , s3_object .key ) for s3_object in s3_objects
189
- ]
190
- except Exception as e : # pylint: disable=W0703
191
- # if customers didn't provide us with a valid S3 File/insufficient read permission,
192
- # We will fail hard.
193
- raise RuntimeError (f"Unable to read from S3 with URI: { s3_uri } due to { e } " )
184
+ s3_bucket = s3_resource_for_config .Bucket (name = bucket )
185
+ s3_objects = s3_bucket .objects .filter (Prefix = key_prefix ).all ()
186
+ s3_files_with_same_prefix = [
187
+ "{}{}/{}" .format (S3_PREFIX , bucket , s3_object .key ) for s3_object in s3_objects
188
+ ]
194
189
if len (s3_files_with_same_prefix ) == 0 :
195
190
# Customer provided us with an incorrect s3 path.
196
191
raise ValueError ("Provide a valid S3 path instead of {}" .format (s3_uri ))
You can’t perform that action at this time.
0 commit comments