Skip to content

[bug] left and right joins should be swapped #163

@daikonradish

Description

@daikonradish

Describe the bug

Haskell's function calls are as such:

fn arg1 arg2 arg3

The joins are such that:

-- This is *supposed* to preserve all keys in the left table.
-- Non matching keys are replaced with NULL.
D.leftJoin ["colname"] leftDf rightDf

-- This is *supposed* to preserve all keys in the right table.
-- Non matching keys are replaced with NULL.
D.rightJoin ["colname"] leftDf rightDf -- all colnames in rightDf preserved, non-matching in left replaced with NULL

However, as pointed out in #156, the behavior appears to be swapped.

Suggested Fix

  1. Verify that the left and right joins are indeed swapped.
  2. Modify the code in src/DataFrame/Operations/Join.hs to ensure that the correct join puts the left dataset on the left and the right dataset on the right
  3. Add and update tests in tests/Operations/Join.hs
  4. Update documentation, because now to use this in conjuntion with pipes, the way to express it is a little tricky: df |> (D.leftJoin other). Note: the documentation should be updated both dataframe/docs/cookbook.md and here.

This task is suitable for anyone who's just getting familiar with our codebases!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions