Skip to content

Commit

Permalink
Revert fs changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinxzhao committed Nov 9, 2022
1 parent 76fb10b commit fd2e42e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ludwig/utils/fs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ def get_bytes_obj_from_path(path: str) -> Optional[bytes]:
if is_http(path):
try:
return get_bytes_obj_from_http_path(path)
except Exception:
except Exception as e:
logger.warning(e)
return None
else:
try:
with open_file(path) as f:
return f.read()
except OSError:
except OSError as e:
logger.warning(e)
return None


Expand Down
3 changes: 2 additions & 1 deletion ludwig/utils/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def is_image(src_path: str, img_entry: Union[bytes, str], column: str) -> bool:
if isinstance(bytes_obj, bytes):
return imghdr.what(None, bytes_obj) is not None
return imghdr.what(bytes_obj) is not None
except Exception:
except Exception as e:
logger.warning(f"While assessing potential image in is_image() for column {column}, encountered exception: {e}")
return False


Expand Down

0 comments on commit fd2e42e

Please sign in to comment.