Skip to content

Conversation

jbrockmendel
Copy link
Member

Agreed upon in yesterday's call.

],
)
def test_assert_idxminmax_raises(self, test_input, error_type):
def test_assert_idxminmax_empty_raises(self, test_input, error_type):
Copy link
Member

Choose a reason for hiding this comment

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

It looks like error_type can be removed from the parametrization now?

ser3 = Series(["foo", "foo", "bar", "bar", None, np.nan, "baz"])
msg = "'>' not supported between instances of 'float' and 'str'"
with pytest.raises(TypeError, match=msg):
ser3.idxmax()
Copy link
Member

Choose a reason for hiding this comment

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

So with object dtype, na-like values are not considered "missing" and rather object scalars so skipna=True has no effect here?

Copy link
Member Author

Choose a reason for hiding this comment

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

the skipping part is done after the np.argmin/np.argmax is done, so that can still raise

@mroeschke mroeschke added the Dtype Conversions Unexpected or buggy dtype conversions label Jul 13, 2023
@mroeschke mroeschke added this to the 2.1 milestone Jul 17, 2023
@mroeschke mroeschke merged commit 394af8e into pandas-dev:main Jul 17, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the enh-argmax branch July 17, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
2 participants