Skip to content

Commit 161d260

Browse files
committed
fix possible null pointer exception
1 parent dd03529 commit 161d260

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

libmultilabel/nn/data_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,8 @@ def load_datasets(
222222
Returns:
223223
dict: A dictionary of datasets.
224224
"""
225-
if isinstance(training_data, str) or isinstance(test_data, str):
226-
assert training_data or test_data, "At least one of `training_data` and `test_data` must be specified."
227-
elif isinstance(training_data, pd.DataFrame) or isinstance(test_data, pd.DataFrame):
228-
assert (
229-
not training_data.empty or not test_data.empty
230-
), "At least one of `training_data` and `test_data` must be specified."
225+
if training_data is None and test_data is None:
226+
raise ValueError("At least one of `training_data` and `test_data` must be specified.")
231227

232228
datasets = {}
233229
if training_data is not None:

0 commit comments

Comments
 (0)