raise exception instead of using assertions.
@mariosasko - Thanks for the review & suggestions. Updated as per the suggestions. 
fix for the remaining files https://github.com/huggingface/datasets/issues/3171