Repository navigation
ENH: Support 3rd-party ExtensionArrays - #4379
Conversation
| cats = None | ||
| data = pd.Categorical(data, categories=cats, | ||
| ordered=s.cat.ordered) | ||
| elif type(dtype) in make_array_nonempty._lookup: |
There was a problem hiding this comment.
It might be slightly cleaner to implement _nonempty_series using make_array_nonempty. I haven't attempted that yet.
|
I'd recommend waiting on this till #4374 is merged. Until we're including the pandas>=0.24.0rc1 in our CI, this will be untested. |
|
I literally chortled with joy when I saw this header in my inbox this morning. I look forward to reviewing this :) |
mrocklin
left a comment
There was a problem hiding this comment.
Thoughts on getting new elementwise operations out of Pandas' extension array API? Or should this be done separately in micro-libraries like dask-cyberpandas for example?
|
|
||
| Developers implementing third-party extension arrays (outside of pandas) will | ||
| need to do register their ``ExtensionDtype`` with Dask so that it works | ||
| correctly in ``dask.dataframe``. |
There was a problem hiding this comment.
Styling note. I think that @farrajota has been capitalizing consistently with the names Dask, Pandas, Dask DataFrame.
By this, you mean things like the Detecting 3rd-party accessors at run-time is easy. They're stored at e.g. The hard part is what's done inside the accessor. There's no requirement that the accessor methods be elementwise operations. (e.g. |
|
Right, so we leave it off for now? |
|
Yes, that's probably best for now. I realized that the tests here basically work for the currently released version of pandas (0.23.4) so this can probably be merged before |
|
Fine by me. I'll merge later today if there are no further comments. Otherwise feel free to merge as you like. |
This adds (basic) support for 3rd party ExtensionArrays in
dask.dataframe.The initial failures stemmed from note being able to create a
_meta_nonemptyfor these dtypes. Rather than trying to guess, we request that authors register their extension dtypes with dask.dataframe.It gets the bare minimum working. It's likely that we'll uncover additional issues, but I haven't thought much about how to test this more thoroughly. This is tested using the
DecimalDtype, which isn't part of pandas public API (it's just a "3rd-party" extension array that's only meant for testing pandas extension array interface).Closes #3240