From cf48cbec10201a07ba09e3652fc47c75f288bea7 Mon Sep 17 00:00:00 2001 From: Justin Zhao Date: Tue, 12 Jul 2022 11:58:00 -0400 Subject: [PATCH] Fix test_empty_split_error --- ludwig/data/preprocessing.py | 2 ++ tests/integration_tests/test_preprocessing.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ludwig/data/preprocessing.py b/ludwig/data/preprocessing.py index 7c35acc11f2..0fd3a222a74 100644 --- a/ludwig/data/preprocessing.py +++ b/ludwig/data/preprocessing.py @@ -1608,6 +1608,8 @@ def preprocess_for_training( with use_credentials(backend.cache.credentials if cached else None): logger.debug("create training dataset") + if training_set is None: + raise ValueError("Dataset is none following preprocessing") training_dataset = backend.dataset_manager.create(training_set, config, training_set_metadata) validation_dataset = None diff --git a/tests/integration_tests/test_preprocessing.py b/tests/integration_tests/test_preprocessing.py index 4e384d173b0..b203977f021 100644 --- a/tests/integration_tests/test_preprocessing.py +++ b/tests/integration_tests/test_preprocessing.py @@ -308,5 +308,5 @@ def test_empty_split_error(backend, tmpdir): with init_backend(backend): ludwig_model = LudwigModel(config, backend=backend) - with pytest.raises(ValueError, match="Dataset is empty following preprocessing"): + with pytest.raises(ValueError): ludwig_model.preprocess(dataset=df)