Skip to content

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

Open

Description

@geetu040

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)

Activity

  1. PGijsbers commented on Feb 18, 2026

    @PGijsbers
    Collaborator

    Assert the correct output shape (should exclude the ignored columns and include row IDs if applicable).

    It does this already, the dataset by default has 20k features (target feature excluded) so the assertion tests whether two features are left out. It doesn't check whether or not it actually leaves out the right features though.

    Verify that categorical indicators are updated accordingly.

    Not sure what you mean with that. I guess it's the same as above, it checks whether the length still is correct but not if the correct features are omitted. That's not possible in this setup. We would need to have a dataset where only two features are categorical (or only 2 are not), and then exclude them.

  2. geetu040 commented on Feb 18, 2026

    @geetu040
    CollaboratorAuthor

    okay I see, in that case, for this dataset, we can only check for the correct lengths and shapes which should be 20000 instead of 19998

  3. Abhishek9639 commented on Feb 22, 2026

    @Abhishek9639
    Contributor

    Hi @geetu040,
    I would like to work on this issue. I understand that we need to properly validate the behavior of include_row_id and include_ignore_attribute in the sparse dataset test.
    I’m a new contributor to the project and would really appreciate the opportunity to work on this. Could you please assign it to me?
    Thank you.

  4. ChiruChirag007 commented on Sep 17, 2026

    @ChiruChirag007

    I have submitted PR #1740 addressing this issue.
    The test now covers row ID and ignore attribute inclusion as requested.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueIssues suitable for people new to contributing to openml-python!module:DataOpenML concepttesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions