Skip to content

fix: raise a clear ValueError when create_dataset gets an empty array - #1779

Open
mayuriphad wants to merge 1 commit into
openml:mainfrom
mayuriphad:fix/create-dataset-empty-array
Open

mayuriphad wants to merge 1 commit into
openml:mainfrom
mayuriphad:fix/create-dataset-empty-array

Conversation

@mayuriphad

Copy link
Copy Markdown

Metadata

Details

create_dataset() read data[0] to detect the data format, so a zero-row list or numpy.ndarray crashed with IndexError: index 0 is out of bounds. It now raises ValueError: 'data' must contain at least one row, but it is empty.

test_create_invalid_dataset gains an empty-array case. It fails with IndexError before the change and passes after.

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>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 04:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] create_dataset() raises IndexError instead of ValueError on empty NumPy array

2 participants