From 9a1368c52bfdfb78eeca1f7ec5b21de4703e214c Mon Sep 17 00:00:00 2001 From: ChiruChirag007 Date: Thu, 17 Sep 2026 10:44:58 +0530 Subject: [PATCH] TEST Add sparse dataset row ID and ignore coverage --- tests/test_datasets/test_dataset.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_datasets/test_dataset.py b/tests/test_datasets/test_dataset.py index c651845fb..cf734aa42 100644 --- a/tests/test_datasets/test_dataset.py +++ b/tests/test_datasets/test_dataset.py @@ -392,11 +392,21 @@ def test_get_sparse_dataset_rowid_and_ignore_and_target(self): # array format returned dense, but now we only return sparse and let the user handle it. assert isinstance(y.dtypes, pd.SparseDtype) assert X.shape == (600, 19998) - assert len(categorical) == 19998 self.assertListEqual(categorical, [False] * 19998) assert y.shape == (600,) + # Test including row ID and ignore attributes + X, y, categorical, _ = self.sparse_dataset.get_data( + target="class", + include_row_id=True, + include_ignore_attribute=True, + ) + assert X.shape == (600, 20000) + assert len(categorical) == 20000 + self.assertListEqual(categorical, [False] * 20000) + assert y.shape == (600,) + def test_get_sparse_categorical_data_id_395(self): dataset = openml.datasets.get_dataset(395, download_data=True) feature = dataset.features[3758]