Skip to content

Conversation

@rhshadrach
Copy link
Member

cc @simonjayhawkins

For the searchsorted test, the categorical data starts off ordered as "C" < "A" < "B" but then gets reordered in the test by these lines:

b, c, a = data_for_sorting
arr = type(data_for_sorting)._from_sequence([a, b, c])

so the ordering becomes "A" < "B" < "C". This causes failure when "C" is said to be inserted at index 3 (new order) to preserve order rather than the expected 0 (original order).

@rhshadrach rhshadrach added the Testing pandas testing functions or related to the test suite label Jan 9, 2021
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @rhshadrach for following up on this.

@jreback jreback added the Categorical Categorical Data Type label Jan 9, 2021
@jreback jreback added this to the 1.3 milestone Jan 9, 2021

if op_name == "__rmod__":
request.node.add_marker(
pytest.mark.xfail(
Copy link
Member

Choose a reason for hiding this comment

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

Is this change related? (I wouldn't know if an xfail is more appropriate here than a skip)

Copy link
Member Author

Choose a reason for hiding this comment

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

Related to #38904 that this PR is trying to close, but not to the other skip/xfail in this PR. Will split off into a separate PR if desired.

This test is doing op(Series, const) expecting it to raise, where Series consists of and const is a string. There is no rmod in the python library operator, and so the test is instead doing lambda x, y: mod(const, Series) . This doesn't raise.

This is always expected to "fail" (meaning not raise), and I think we'd want to know if it didn't. This is why I went with xfail over skip here.

@jreback jreback merged commit 6b3618d into pandas-dev:master Jan 12, 2021
@jreback
Copy link
Contributor

jreback commented Jan 12, 2021

thanks @rhshadrach

@rhshadrach rhshadrach deleted the skips_in_test_categorical branch January 12, 2021 01:28
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Categorical Categorical Data Type Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TST: skips in extension.test_categorical

4 participants