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

BUG: fused types incorrectly raising TypeError by miscounting arguments #2647

Open
jbrockmendel opened this Issue Oct 7, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@jbrockmendel

jbrockmendel commented Oct 7, 2018

Trying to transition this function to use fused types instead of tempita:

# @cython.wraparound(False)
# @cython.boundscheck(False)
def left_join_indexer(ndarray[join_t] left, ndarray[join_t] right):
     [...]

left_join_indexer_float64 = left_join_indexer["float64_t"]
left_join_indexer_float32 = left_join_indexer["float32_t"]
left_join_indexer_object = left_join_indexer["object"]
left_join_indexer_int32 = left_join_indexer["int32_t"]
left_join_indexer_int64 = left_join_indexer["int64_t"]
left_join_indexer_uint64 = left_join_indexer["uint64_t"]

This is causing test failures e.g.

____________________________________ TestJoin.test_join_mixed_non_unique_index ____________________________________

self = <pandas.tests.reshape.merge.test_join.TestJoin object at 0x141ed7750>

    def test_join_mixed_non_unique_index(self):
        # GH 12814, unorderable types in py3 with a non-unique index
        df1 = DataFrame({'a': [1, 2, 3, 4]}, index=[1, 2, 3, 'a'])
        df2 = DataFrame({'b': [5, 6, 7, 8]}, index=[1, 3, 3, 4])
>       result = df1.join(df2)

pandas/tests/reshape/merge/test_join.py:542: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas/core/frame.py:6562: in join
    rsuffix=rsuffix, sort=sort)
pandas/core/frame.py:6577: in _join_compat
    suffixes=(lsuffix, rsuffix), sort=sort)
pandas/core/reshape/merge.py:63: in merge
    return op.get_result()
pandas/core/reshape/merge.py:564: in get_result
    join_index, left_indexer, right_indexer = self._get_join_info()
pandas/core/reshape/merge.py:761: in _get_join_info
    sort=self.sort)
pandas/core/indexes/base.py:3867: in join
    return this.join(other, how=how, return_indexers=return_indexers)
pandas/core/indexes/base.py:3877: in join
    return_indexers=return_indexers)
pandas/core/indexes/base.py:4137: in _join_monotonic
    join_index, lidx, ridx = self._left_indexer(sv, ov)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   def left_join_indexer(ndarray[join_t] left, ndarray[join_t] right):
E   TypeError: left_join_indexer() takes exactly 2 positional arguments (3 given)

Any idea what would cause it to think 3 arguments were passed?

@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Oct 14, 2018

Contributor

self maybe ? Is self._left_indexer a function that was assigned to a class attribute?

Contributor

scoder commented Oct 14, 2018

self maybe ? Is self._left_indexer a function that was assigned to a class attribute?

@jbrockmendel

This comment has been minimized.

Show comment
Hide comment
@jbrockmendel

jbrockmendel Oct 14, 2018

a function that was assigned to a class attribute?

Wow, yah. In pandas.core.indexes.base its pinned to the Index class _left_indexer = libjoin.left_join_indexer_object

jbrockmendel commented Oct 14, 2018

a function that was assigned to a class attribute?

Wow, yah. In pandas.core.indexes.base its pinned to the Index class _left_indexer = libjoin.left_join_indexer_object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment