Skip to content
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

BUG: Fixed bug, where pandas._libs.lib.maybe_convert_objects function improperly handled arrays with bools and NaNs #32242

Merged

Conversation

AnnaDaglis
Copy link
Contributor

… improperly handled arrays with bools and NaNs
@WillAyd WillAyd added the NA - MaskedArrays Related to pd.NA and nullable extension arrays label Feb 26, 2020
doc/source/whatsnew/v1.1.0.rst Outdated Show resolved Hide resolved
pandas/tests/dtypes/test_inference.py Show resolved Hide resolved
@jreback jreback added this to the 1.0.2 milestone Feb 27, 2020
@simonjayhawkins simonjayhawkins added the Regression Functionality that used to work in a prior pandas version label Feb 27, 2020
@pep8speaks
Copy link

pep8speaks commented Feb 27, 2020

Hello @AnnaDaglis! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-03-04 13:58:45 UTC

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.

if you can move the test, ping on green. (pls also merge master)

pandas/tests/indexes/base_class/test_repr.py Outdated Show resolved Hide resolved
…ith_nans_issue

Fix Series representation of an object Index with bools and NaN
@AnnaDaglis
Copy link
Contributor Author

@jreback All tests passed.

doc/source/whatsnew/v1.0.2.rst Outdated Show resolved Hide resolved
),
],
)
def test_value_counts_bool_with_nan(self, ser, dropna, exp):
Copy link
Contributor

Choose a reason for hiding this comment

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

I may have misunderstood the original issue, but my understanding is that the values were correct, just the repr was wrong. If so, why are we adding new tests here, which I think don't cover the reported issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see it was requested by @jreback in https://github.com/pandas-dev/pandas/pull/32242/files#r385098106. I suppose no harm in more tests, but don't we think this is already tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TomAugspurger Yes, I agree that this has been tested. Was following the suggestion of @jreback.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jreback can you comment on the request / need for these tests?

pandas/tests/indexes/test_base.py Show resolved Hide resolved
pandas/tests/indexes/test_base.py Outdated Show resolved Hide resolved
@jbrockmendel jbrockmendel mentioned this pull request Mar 4, 2020
AnnaDaglis and others added 4 commits March 4, 2020 12:38
Co-Authored-By: Tom Augspurger <TomAugspurger@users.noreply.github.com>
…ith_nans_issue

Fixed bug in the repr of an object-dtype with bools and missing values
@AnnaDaglis
Copy link
Contributor Author

@TomAugspurger @jreback All tests passed.

@AnnaDaglis AnnaDaglis requested a review from jreback March 6, 2020 11:55
Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

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

LGTM, pending the question on the new tests.

),
],
)
def test_value_counts_bool_with_nan(self, ser, dropna, exp):
Copy link
Contributor

Choose a reason for hiding this comment

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

@jreback can you comment on the request / need for these tests?

@TomAugspurger
Copy link
Contributor

Ok, let's merge this. Having extra tests probably isn't a bad thing :)

Thanks @AnnaDaglis, and congrats on your first PR to pandas!

@TomAugspurger TomAugspurger merged commit 787dc8a into pandas-dev:master Mar 9, 2020
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Mar 9, 2020
…maybe_convert_objects function improperly handled arrays with bools and NaNs
@AnnaDaglis AnnaDaglis deleted the fix_index_bools_with_nans_issue branch March 9, 2020 17:26
@jorisvandenbossche
Copy link
Member

Thanks @AnnaDaglis !

TomAugspurger pushed a commit that referenced this pull request Mar 10, 2020
…ert_objects function improperly handled arrays with bools and NaNs (#32552)

Co-authored-by: Anna Daglis <40292327+AnnaDaglis@users.noreply.github.com>
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
… improperly handled arrays with bools and NaNs (pandas-dev#32242)

* BUG: Fixed bug, where pandas._libs.lib.maybe_convert_objects function improperly handled arrays with bools and NaNs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGR: Series repr of object Index with bools and NaN is wrong
8 participants