-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
DOC: Various EA docs #20707
Conversation
doc/source/extending.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
doc/source/extending.rst
Outdated
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 |
There was a problem hiding this comment.
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?
BTW, I see some other docs changes (re: Python 2.7 support) that aren't quite pertinent to |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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 |
There was a problem hiding this comment.
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).
pandas/core/arrays/base.py
Outdated
@@ -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. |
There was a problem hiding this comment.
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)
?
thanks @TomAugspurger |
Closes #20668