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

Change _can_hold_na to a class attribute and document that it shouldn't be changed #20819

Merged
merged 9 commits into from
Apr 26, 2018

Conversation

Dr-Irv
Copy link
Contributor

@Dr-Irv Dr-Irv commented Apr 25, 2018

Replaces pull request #20815 (see discussion there for reasoning)

@TomAugspurger TomAugspurger added the ExtensionArray Extending pandas with custom dtypes or arrays. label Apr 25, 2018
@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Apr 25, 2018
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. Will wait a bit if @jorisvandenbossche or @jreback have thoughts.

@@ -21,7 +21,7 @@ def test_ndim(self, data):
assert data.ndim == 1

def test_can_hold_na_valid(self, data):
assert data._can_hold_na in {True, False}
assert data._can_hold_na # Must be True
Copy link
Contributor

Choose a reason for hiding this comment

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

you can assert data._can_hold_na is True, otherwise this is not strictly checking that it is an actual boolean True

@Dr-Irv
Copy link
Contributor Author

Dr-Irv commented Apr 26, 2018

@TomAugspurger It seems that you made the change that @jreback asked for. Anything else for me to do?

@TomAugspurger
Copy link
Contributor

Nope, we're good. Thanks!.

@TomAugspurger TomAugspurger merged commit 6cacdde into pandas-dev:master Apr 26, 2018
@Dr-Irv Dr-Irv deleted the nocanholdna branch June 29, 2018 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExtensionArray._can_hold_na needs to be a class attribute
3 participants