Skip to content

use public pandas API instead of pandas.core #28

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
tswast opened this issue Oct 13, 2021 · 3 comments · Fixed by #60 or #90
Closed

use public pandas API instead of pandas.core #28

tswast opened this issue Oct 13, 2021 · 3 comments · Fixed by #60 or #90
Labels
api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. type: cleanup An internal cleanup or hygiene concern.

Comments

@tswast
Copy link
Collaborator

tswast commented Oct 13, 2021

The stability of pandas.core is not guaranteed. We should use pandas where we can and raise an issue with pandas where not available.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. label Oct 13, 2021
@tswast tswast added the type: cleanup An internal cleanup or hygiene concern. label Oct 13, 2021
@jbrockmendel
Copy link

I'd also suggest making a PR in pandas to make e.g. NDArrayBackedExtensionArray public

@jbrockmendel
Copy link

You might be able to trim some code by using DatetimeLikeArrayMixin instead of NDArrayBackedExtensionArray

@jorisvandenbossche
Copy link

To give a few examples, from taking a look at __init__/core.py:

  • pandas.core.dtypes.dtypes.register_extension_dtype -> pandas.api.extensions.register_extension_dtype (the same for ExtensionDtype).
  • from pandas.core.dtypes.common import is_dtype_equal, is_list_like, pandas_dtype -> from pandas.api.types import is_dtype_equal, is_list_like, pandas_dtype

The pandas.core.nanops.nan... functions have no public alternative at the moment. I am not sure we should expose them somewhere though, so you can maybe just keep those as is (they also haven't changed the last years I think).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-db-dtypes-pandas API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
3 participants