Repository navigation
fix: raise a clear ValueError when create_dataset gets an empty array - #1779
mayuriphad wants to merge 2 commits into
Conversation
create_dataset read data[0] to detect the data format, so an empty list or numpy array raised IndexError instead of a descriptive ValueError. Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Hi, just a gentle ping on this PR. It's ready for review whenever you have time, and I'm happy to make any changes you'd like. Thanks! |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
shreyashsri79
left a comment
There was a problem hiding this comment.
LLM generated content, by GPT-6 (Codex)
Independent, focused offline review of Mayuri's change at f8d03ff, linked to #1777. No blocking finding within this scope.
- On current main f4fd28e, six empty-input probes (empty list, 1-D array, three zero-row array shapes, and a two-column DataFrame) reproduced
IndexError. They all raised the intended descriptiveValueErroron this head and with this PR's patch applied to current main. - Four nonempty examples (dense list/array, sparse dictionary rows, and COO matrix) still constructed datasets with the expected dense/sparse ARFF format on all three versions.
tests/test_datasets/test_dataset_functions.py::TestOpenMLDataset::test_create_invalid_datasetpassed on both candidates: 1 passed each. I invoked pytest through a process-local socket-blocking wrapper with-m "not production_server and not test_server"; no network attempts were recorded during import, probes, test or teardown.
Environment: Python 3.14.7, NumPy 2.5.4, pandas 3.1.1, SciPy 1.18.1, pytest 9.2.0. Both test runs emitted one collection-time deprecation warning about an unrelated itertools.product parametrization. Full suite, server tests, pre-commit and other Python versions were not run locally. These are local results, not hosted-CI results.
|
Hi, is there anything else you need from me on this PR? I'm happy to make changes. Thanks! |
Metadata
create_dataset()raisingIndexErrorinstead ofValueErrorfor an empty list or arrayDetails
create_dataset()readdata[0]to detect the data format, so a zero-row list ornumpy.ndarraycrashed withIndexError: index 0 is out of bounds. It now raisesValueError: 'data' must contain at least one row, but it is empty.test_create_invalid_datasetgains an empty-array case. It fails withIndexErrorbefore the change and passes after.