Skip to content
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

Join of identical non-unique indexes is not correct #519

Open
pityka opened this issue Jun 7, 2023 · 0 comments
Open

Join of identical non-unique indexes is not correct #519

pityka opened this issue Jun 7, 2023 · 0 comments

Comments

@pityka
Copy link
Owner

pityka commented Jun 7, 2023

  "Outer join of same non-unique indexes " in {
      val ix1 = Index(0, 0)
      val ix2 = Index(0, 0)
      val res = ix1.join(ix2, how = index.OuterJoin)
      /*
        Outer join two columns with repeated values should generate all possible pairs

        Correct assertions:
      res.index must_== Index(0, 0, 0, 0)
      res.lTake.get must_== Array(0, 0, 1, 1)
      res.rTake.get must_== Array(0, 1, 0, 1)

      However the current implementation has a shortcut for identical indexes and passes these:
       */
      res.index must_== Index(0, 0)
      res.lTake must_== None
      res.rTake must_== None

    }

This is because in the implementation there is a shortcut:

def join(left: Index[T], right: Index[T], how: JoinType): ReIndexer[T] = {
    if (left == right) {
      ReIndexer(None, None, right)
    } else if..

The above condition should check for uniqueness.

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

No branches or pull requests

1 participant