Raise ImportError instead of OSError if required extraction library is not installed
CONTRIBUTOR
hey ,i would like to work on this issue . Please assign it to me.
2022-10-18T19:43:52Z
https://github.com/huggingface/datasets/issues/5134#issuecomment-1282917676
https://api.github.com/repos/huggingface/datasets/issues/5134
IC_kwDODunzps5Md8Us
https://api.github.com/repos/huggingface/datasets/issues/comments/1282917676/reactions
2022-10-18T19:43:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1282917676
https://avatars.githubusercontent.com/u/114604338?v=4
https://api.github.com/users/ayushthe1/events{/privacy}
https://api.github.com/users/ayushthe1/followers
https://api.github.com/users/ayushthe1/following{/other_user}
https://api.github.com/users/ayushthe1/gists{/gist_id}
https://github.com/ayushthe1
ayushthe1
U_kgDOBtS5Mg
https://api.github.com/users/ayushthe1/orgs
https://api.github.com/users/ayushthe1/received_events
https://api.github.com/users/ayushthe1/repos
https://api.github.com/users/ayushthe1/starred{/owner}{/repo}
https://api.github.com/users/ayushthe1/subscriptions
User
https://api.github.com/users/ayushthe1
public
CONTRIBUTOR
hey @mariosasko , i made a pr for this issue. Could you please review it.
Also i found multiple `OSError` in `extract.py` file which i thought could be replaced too but wasn't sure about them.
Please do tell if that also needs to be done.
2022-10-19T19:34:38Z
https://github.com/huggingface/datasets/issues/5134#issuecomment-1284481563
https://api.github.com/repos/huggingface/datasets/issues/5134
IC_kwDODunzps5Mj6Ib
https://api.github.com/repos/huggingface/datasets/issues/comments/1284481563/reactions
2022-10-19T19:34:38Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1284481563
https://avatars.githubusercontent.com/u/114604338?v=4
https://api.github.com/users/ayushthe1/events{/privacy}
https://api.github.com/users/ayushthe1/followers
https://api.github.com/users/ayushthe1/following{/other_user}
https://api.github.com/users/ayushthe1/gists{/gist_id}
https://github.com/ayushthe1
ayushthe1
U_kgDOBtS5Mg
https://api.github.com/users/ayushthe1/orgs
https://api.github.com/users/ayushthe1/received_events
https://api.github.com/users/ayushthe1/repos
https://api.github.com/users/ayushthe1/starred{/owner}{/repo}
https://api.github.com/users/ayushthe1/subscriptions
User
https://api.github.com/users/ayushthe1
public
According to the official Python docs, `OSError` should be thrown in the following situations:
> This exception is raised when a system function returns a system-related error, including I/O failures such as “file not found” or “disk full” (not for illegal argument types or other incidental errors).

Hence, it makes more sense to raise `ImportError` instead of `OSError` when the required extraction/decompression library is not installed.