Skip to content

DOC: Various EA docs #20707

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 2 commits into from
Apr 21, 2018
Merged

DOC: Various EA docs #20707

merged 2 commits into from
Apr 21, 2018

Conversation

TomAugspurger
Copy link
Contributor

Closes #20668

@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Apr 15, 2018
@TomAugspurger TomAugspurger added the ExtensionArray Extending pandas with custom dtypes or arrays. label Apr 15, 2018
@@ -106,6 +113,24 @@ by some other storage type, like Python lists.
See the `extension array source`_ for the interface definition. The docstrings
and comments contain guidance for properly implementing the interface.

We provide a test suite for ensuring that your extension arrays satisfy the expected
behavior. To use the test-suite, you must provide several pytest fixtures and inherit
Copy link
Member

Choose a reason for hiding this comment

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

"test-suite" or "test suite" (without the dash)? You use both.

from the base test class. The required fixtures are found in
https://github.com/pandas-dev/pandas/blob/master/pandas/tests/extension/conftest.py.

To use a test, subclass it
Copy link
Member

Choose a reason for hiding this comment

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

Nit: do we want a colon at the end of this sentence?

@gfyoung
Copy link
Member

gfyoung commented Apr 15, 2018

BTW, I see some other docs changes (re: Python 2.7 support) that aren't quite pertinent to ExtensionArray, but they're minor enough that they should be fine.

@codecov
Copy link

codecov bot commented Apr 16, 2018

Codecov Report

Merging #20707 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20707      +/-   ##
==========================================
+ Coverage   91.81%   91.82%   +0.01%     
==========================================
  Files         153      153              
  Lines       49279    49307      +28     
==========================================
+ Hits        45245    45276      +31     
+ Misses       4034     4031       -3
Flag Coverage Δ
#multiple 90.21% <ø> (+0.01%) ⬆️
#single 41.89% <ø> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/base.py 84.14% <ø> (ø) ⬆️
pandas/core/arrays/categorical.py 95.78% <0%> (-0.41%) ⬇️
pandas/io/pytables.py 92.41% <0%> (-0.05%) ⬇️
pandas/core/internals.py 95.53% <0%> (-0.01%) ⬇️
pandas/core/groupby/groupby.py 92.55% <0%> (ø) ⬆️
pandas/core/indexes/datetimelike.py 96.72% <0%> (ø) ⬆️
pandas/core/generic.py 95.94% <0%> (ø) ⬆️
pandas/core/frame.py 97.16% <0%> (ø) ⬆️
pandas/core/window.py 96.29% <0%> (+0.02%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f7f3d4...f425ad9. Read the comment docs.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Minor comments, looks good to me

@@ -14,12 +14,15 @@ class ExtensionArray(object):
with a custom type and will not attempt to coerce them to objects. They
may be stored directly inside a :class:`DataFrame` or :class:`Series`.

.. versionadded:: 0.23.0
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a note about the experimental status in this file as well (eg in module docstring at line 1).

@@ -35,6 +38,15 @@ class ExtensionArray(object):
* _can_hold_na
* _formatting_values

Some methods require casting the ExtensionArray to an ndarray of Python
objects, which may be expensive. When performance is a concern, we highly
recommend overriding the following methods.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe clarify that those have a default working implementation, but do a self.astype(object) ?

@jreback jreback merged commit 23bc217 into pandas-dev:master Apr 21, 2018
@jreback
Copy link
Contributor

jreback commented Apr 21, 2018

thanks @TomAugspurger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants