REF: Move pandas.core.categorical by TomAugspurger · Pull Request #19269 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation18 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

TomAugspurger

TomAugspurger

"""
try:
codes = np.asarray(codes, np.int64)
except (ValueError, TypeError):

Choose a reason for hiding this comment

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

Note: I changed this from except Exception for the linter.

Choose a reason for hiding this comment

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

+1

TomAugspurger

msg = self._get_repr(length=False, footer=True).replace("\n", ", ")
result = ('[], {repr_msg}'.format(repr_msg=msg))
return re

Choose a reason for hiding this comment

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

Is this unavoidable for older pickle files?

Choose a reason for hiding this comment

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

not sure what you are pointing to. but you need to have an entry in pandas.compat/pickle_compat.py to handle the pickle compat

Choose a reason for hiding this comment

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

Thanks. I thought we had something like that.

@TomAugspurger

@jreback

you could add a deprecating module (e.g. like tslib.py) in the to-level to make a nice transition

@jbrockmendel

This looks pretty benign to me (I'm assuming there weren't any clandestine changes in the cut/paste).

I'd argue for calling it vectors instead of arrays so as to a) draw a clear distinction between the responsibilities of these objects vs np.array vs pd2 WIP and b) emphasize "FooVector is a vectorized version of FooScalar" (admittedly a motivation more specific to the arith/comparisons I've been focused on)

@jreback

you prob need to change the paths in api.rst as well

@jreback

I'd argue for calling it vectors instead of arrays so as to a) draw a clear distinction between the responsibilities of these objects vs np.array vs pd2 WIP and b) emphasize "FooVector is a vectorized version of FooScalar" (admittedly a motivation more specific to the arith/comparisons I've been focused on)

no this is naming scheme is well-established

@TomAugspurger

api.rst is all good. All the references via the public API.

@codecov

@jreback

not sure if you saw my comment above. I think you need a dummpy pandas.core.categorical.py which shows a FutureWarning.

@TomAugspurger

Yeah I have one. The diff is strange. The warning is at the top, and the import is at the bottom.

@jreback

I c, ok. can you add a test for this (maybe in test_api), and add to the deprecations list. otherwise lgtm.

@TomAugspurger

@TomAugspurger

Moved pandas.core.categorical to arrays.

@TomAugspurger

Are we cool with merging PRs before the Mac build finishes? Travis had another outage, so they're backlogged again.

@TomAugspurger