[MNT] Complete Test for Sparse Dataset Row ID and Ignore Attributes Inclusion

Open Beginner friendly
#1,644 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data, testing-qa

Research direction

Start in tests/test_datasets/test_dataset.py at test_get_sparse_dataset_rowid_and_ignore_and_target, then run that test to inspect its current sparse-dataset behavior. Extend or add the case using target="class", include_row_id=True, and include_ignore_attribute=True. Done means the assertions cover the expected output shape, row IDs, excluded ignored columns, and updated categorical indicators.

Written by the indexing model from the issue text.

Description

Good First Issue module:Data testing

The test test_get_sparse_dataset_rowid_and_ignore_and_target in test_dataset.py#L382 currently sets ignore_attribute and row_id_attribute on a sparse dataset but calls get_data() with include_row_id=False and include_ignore_attribute=False. This means the test doesn't verify behavior when these attributes are actually included in the output.

Steps:

  1. Add a new test case or extend the existing one to call get_data(target="class", include_row_id=True, include_ignore_attribute=True).
  2. Assert the correct output shape (should exclude the ignored columns and include row IDs if applicable).
  3. Verify that categorical indicators are updated accordingly.
  4. Run the test to ensure it passes with the sparse dataset.

The test should validate that sparse datasets handle row ID and ignore attributes correctly when included, improving test coverage for edge cases.

Source: Mentioned TODO in source code (same line)

Dominant language
Python
Stars
361
Forks
296
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openml/openml-python

All issues in openml/openml-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.