Skip to content

BUG: better exception on invalid slicing on CategoricalIndex #40364

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

Merged
merged 6 commits into from
Mar 20, 2021

Conversation

jbrockmendel
Copy link
Member

After fixing the CategoricalIndex behavior (first commit), the "kind" keyword is no longer needed in _maybe_cast_slice_bound, so removed that.

After this the keyword is no longer needed in get_slice_bound, slice_locs, slice_indexer, but those are technically public so didnt rip them out.

@jbrockmendel
Copy link
Member Author

cc @TomAugspurger docbuild looks like dask is using _maybe_cast_slice_bound

~/miniconda3/envs/pandas-dev/lib/python3.8/site-packages/dask/dataframe/indexing.py in _maybe_partial_time_string(index, indexer, kind)
    352     if isinstance(indexer, slice):
    353         if isinstance(indexer.start, str):
--> 354             start = index._maybe_cast_slice_bound(indexer.start, "left", kind)
    355         else:
    356             start = indexer.start

TypeError: _maybe_cast_slice_bound() takes 3 positional arguments but 4 were given

@jreback jreback added Categorical Categorical Data Type Clean labels Mar 20, 2021
@jreback jreback added this to the 1.3 milestone Mar 20, 2021
@jreback jreback merged commit 64e87b3 into pandas-dev:master Mar 20, 2021
@jbrockmendel jbrockmendel deleted the ref-ci-special branch March 20, 2021 02:01
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Clean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants