Skip to content

DataFrame merge method change Left and Right values #5767

Closed

Description

System information

  • OS version/distro: Windows 10
  • .NET Version (eg., dotnet --info): 5.0.201

Issue

  • What did you do?

I used DataFrame,Merge method with Algo Inner and Right dataframe having less rows than left dataframe

  • What happened?

Right values are merged into Left columns and Left values into right columns

  • What did you expect?

I expected the left values to be merged into columns "_left" suffix and right values into columns with "_right" suffix

Source code / logs

Unit test to reproduce (expect to work same way for (1,2) and (2,1)):

[Theory]
[InlineData(1, 2)]
[InlineData(2, 1)]
public void TestMerge_3(int leftCount, int rightCount)
{
DataFrame left = MakeDataFrameWithNumericColumns(leftCount, false);
DataFrameColumn leftStringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, leftCount).Select(x => "Left"));
left.Columns.Insert(left.Columns.Count, leftStringColumn);

        DataFrame right = MakeDataFrameWithNumericColumns(rightCount, false);
        DataFrameColumn rightStringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, rightCount).Select(x => "Right"));
        right.Columns.Insert(right.Columns.Count, rightStringColumn);

        DataFrame merge = left.Merge<int>(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Inner);

        Assert.Equal("Left", (string)merge.Columns["String_left"][0]);
        Assert.Equal("Right", (string)merge.Columns["String_right"][0]);
    }

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions