When using custom data configuration, I noticed that when the user passes an invalid value to one of the arguments, the load_dataset() script throws an UnboundLocalError. Here is the trace
Using custom data configuration or_queries-db81180f5f5e3006
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/home/.local/share/virtualenvs/17147-yQ3Y_lVD/lib/python3.8/site-packages/datasets/load.py", line 1734, in load_dataset
builder_instance = load_dataset_builder(
File "/Users/home/.local/share/virtualenvs/17147-yQ3Y_lVD/lib/python3.8/site-packages/datasets/load.py", line 1518, in load_dataset_builder
builder_instance: DatasetBuilder = builder_cls(
File "/Users/home/.local/share/virtualenvs/17147-yQ3Y_lVD/lib/python3.8/site-packages/datasets/builder.py", line 1357, in __init__
super().__init__(*args, **kwargs)
File "/Users/home/.local/share/virtualenvs/17147-yQ3Y_lVD/lib/python3.8/site-packages/datasets/builder.py", line 332, in __init__
info.update(self._info())
File "/Users/home/.cache/huggingface/modules/datasets_modules/datasets/bt--os/53db9a9f034b31f75fc6d7c2efcdada9ece579d47c62b9a1c39dd1969da4ecb1/os.py", line 189, in _info
features=features,
UnboundLocalError: local variable 'features' referenced before assignment
I thought I could catch this error by validating the input but it is ignored. i also tried to add a conditional block around the return statement inside the _info() but it is ignored. How can I throw a ValueError back to the user similar to what happens when passing an invalid name
attribute ?