Skip to content

Public API for extension arrays / types. #23532

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

Closed
wants to merge 3 commits into from

Conversation

TomAugspurger
Copy link
Contributor

@TomAugspurger TomAugspurger commented Nov 6, 2018

API Changes

Adds

  • pandas.integer_array
  • pandas.period_array
  • pandas.IntervalArray
  • pandas.CategoricalDtype
  • pandas.api.extensions.IntergerArray
  • pandas.api.extensions.PeriodDtype
  • pandas.api.extensions.PeriodArray
  • pandas.api.extensions.IntervalDtype
  • pandas.api.extensions.DatetimeTZDtype

And adds documentation for those.

The organizing principle here is "what's useful to users." integer_array is useful to users, so it's in the top-level, while IntegerArray isn't so useful on it's own, so it's in api.extensions. IntervalArray is useful, so it's at the top-level.

Closes #22860

**API Changes**

Adds

* pandas.integer_array
* pandas.period_array
* pandas.IntervalArray
* pandas.CategoricalDtype
* pandas.api.extensions.IntergerArray
* pandas.api.extensions.PeriodDtype
* pandas.api.extensions.PeriodArray
* pandas.api.extensions.IntervalDtype
* pandas.api.extensions.DatetimeTZDtype

And adds documentation for those.
@TomAugspurger TomAugspurger added Docs ExtensionArray Extending pandas with custom dtypes or arrays. labels Nov 6, 2018
@pep8speaks
Copy link

Hello @TomAugspurger! Thanks for submitting the PR.

@TomAugspurger TomAugspurger changed the title Ea public api Public API for extension arrays / types. Nov 6, 2018
@codecov
Copy link

codecov bot commented Nov 6, 2018

Codecov Report

Merging #23532 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23532      +/-   ##
==========================================
+ Coverage   92.25%   92.25%   +<.01%     
==========================================
  Files         161      161              
  Lines       51186    51189       +3     
==========================================
+ Hits        47222    47225       +3     
  Misses       3964     3964
Flag Coverage Δ
#multiple 90.64% <100%> (ø) ⬆️
#single 42.28% <80%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/arrays/interval.py 93.02% <ø> (ø) ⬆️
pandas/core/arrays/categorical.py 95.21% <ø> (ø) ⬆️
pandas/core/arrays/period.py 98.08% <100%> (ø) ⬆️
pandas/core/api.py 100% <100%> (ø) ⬆️
pandas/api/extensions/__init__.py 100% <100%> (ø) ⬆️

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 6bf6cd2...2e492bc. Read the comment docs.

===================================== ==============================
:class:`Categorical` :ref:`categorical`
:class:`DatetimeArray` TODO
:class:`api.extensions.IntegerArray` :ref:`integer_na`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be consistent here, moving IntegerArray & PeriodArray into pd namespace

import pandas as pd

.. _integer_na:

Copy link
Contributor

Choose a reason for hiding this comment

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

not really sure we need a whole section for this. Feels a bit odd actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could also put it in missing_data.rst?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah sure

@TomAugspurger TomAugspurger mentioned this pull request Nov 8, 2018
2 tasks
@TomAugspurger
Copy link
Contributor Author

This is being superseded by #23581.

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.

3 participants