Skip to content

TST: tests for setitem-like casting issues #45154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

jbrockmendel
Copy link
Member

I'm pretty sure a bunch of tests currently in tests.indexing.test_coercion can be ported to use the SetitemCastingEquivalents pattern, but there are some xfails ATM.

Closes a bunch of issues, implements xfailed tests for several more.

Most of the tests this adds will need to be cleaned up/parametrized. ATM im just trying to whittle down the open setitem-casting related issues

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Jan 2, 2022
@jreback jreback added this to the 1.4 milestone Jan 3, 2022
@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves labels Jan 3, 2022
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. all comments for followon (e.g. name the tests better) :->

super().test_mask_key(obj, key, expected, val, indexer_sli)


def test_20643():
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename to something more informative

tm.assert_frame_equal(df, expected_df)


def test_20643_comment():
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to better

tm.assert_series_equal(ser, expected)


def test_15413():
Copy link
Contributor

Choose a reason for hiding this comment

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

rename to better

tm.assert_frame_equal(df, expected)


def test_37692(indexer_al):
Copy link
Contributor

Choose a reason for hiding this comment

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

rename

tm.assert_series_equal(ser, expected)


def test_26395(indexer_al):
Copy link
Contributor

Choose a reason for hiding this comment

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

rename

tm.assert_frame_equal(df, expected)


def test_32878_int_itemsize():
Copy link
Contributor

Choose a reason for hiding this comment

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

rename

indexer_sli(ser)[0] = np.int64(1)


def test_6942(indexer_al):
Copy link
Contributor

Choose a reason for hiding this comment

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

rename



@pytest.mark.xfail(reason="unwanted upcast")
def test_15231():
Copy link
Contributor

Choose a reason for hiding this comment

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

rename

@jreback jreback merged commit d70b95b into pandas-dev:master Jan 3, 2022
@jbrockmendel jbrockmendel deleted the bugs-numeric_casting branch January 3, 2022 23:28
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 Indexing Related to indexing on series/frames, not to indexes themselves Testing pandas testing functions or related to the test suite
Projects
None yet
3 participants