Skip to content

BUG: get_indexer returned dtype #36431

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 7 commits into from
Sep 19, 2020
Merged

Conversation

alexhlim
Copy link
Member

Changed the return dtype of IndexEngine’s get_indexer() and get_indexer_non_unique(). I decided to not include tests because dtypes are already implicitly tested in the following:

  • pandas/tests/indexes/test_base.py (TestIndex.test_get_indexer)
  • pandas/tests/base/test_misc.py (test_get_indexer_non_unique_dtype_mismatch)

Also, I ran the asv benchmarks:

asv continuous -f 1.1 upstream/master HEAD -b ^indexing_engines
BENCHMARKS NOT SIGNIFICANTLY CHANGED.

@alexhlim alexhlim changed the title get_indexer dtype get_indexer returned dtype Sep 17, 2020
@alexhlim alexhlim changed the title get_indexer returned dtype BUG: get_indexer returned dtype Sep 17, 2020
@jreback jreback added the Compat pandas objects compatability with Numpy or Python functions label Sep 17, 2020
@jreback jreback added this to the 1.2 milestone Sep 19, 2020
@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves labels Sep 19, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

pls merge master as well

@@ -347,7 +347,7 @@ cdef class {{name}}HashTable(HashTable):
int ret = 0
{{dtype}}_t val
khiter_t k
int64_t[:] locs = np.empty(n, dtype=np.int64)
Copy link
Contributor

Choose a reason for hiding this comment

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

are these all the int64's in this file? (that are indexers)

@@ -266,7 +266,7 @@ cdef class IndexEngine:
"""
cdef:
ndarray values, x
ndarray[int64_t] result, missing
Copy link
Contributor

Choose a reason for hiding this comment

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

are all of these indexer changed int his file?

@jreback
Copy link
Contributor

jreback commented Sep 19, 2020

cc @jbrockmendel

@jbrockmendel
Copy link
Member

LGTM

@jreback jreback merged commit 54f23e8 into pandas-dev:master Sep 19, 2020
@jreback
Copy link
Contributor

jreback commented Sep 19, 2020

thanks @alexhlim

@alexhlim alexhlim deleted the get_indexer_dtype branch September 19, 2020 20:24
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: get_indexer methods return int64 instead of intp arrays
3 participants