Skip to content

Conversation

@wagner-austin
Copy link
Contributor

Description

The test_numeric_split_direction test was skipping the [use_missing=True, zero_as_missing=True] parameter combination instead of properly testing it.

When both flags are True:

  • use_missing=True: NaN values are treated as missing
  • zero_as_missing=True: Zero values are also treated as missing
  • Both zeros and NaN reach the same leaf (both are "missing")

The original assertion assert expected_leaf_zero != expected_leaf_nan would fail for this case, which is why it was skipped. The fix properly tests this case by checking for the same leaf when zero_as_missing=True.

Test Plan

BEFORE (master):

  • test_numeric_split_direction[True-True]: SKIPPED
  • test_numeric_split_direction[True-False]: PASSED
  • test_numeric_split_direction[False-True]: PASSED
  • test_numeric_split_direction[False-False]: PASSED
  • Total: 3 passed, 1 skipped

AFTER (this PR):

  • All 4 parameter combinations: PASSED
  • Total: 4 passed, 0 skipped

…er combinations

The test was skipping the [use_missing=True, zero_as_missing=True] combination
instead of properly testing it. When both flags are True, zeros and NaN are both
treated as missing and reach the same leaf. The assertion now correctly checks
for same leaf (when zero_as_missing=True) vs different leaves (when False).
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Oh interesting, thanks so much for looking into this!!

The proposed changes and code comments look clear and correct to me. this is a nice improvement to the testing coverage.

I see that pytest.skip() was added in #5119 but I don't recall why and don't see conversation related to it. @jmoralez could you double-check this PR if you have time?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants