Skip to content

DataFrame.Merge method incorrect behavior #5765

Closed
@asmirnov82

Description

@asmirnov82

System information

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

Issue

  • What did you do?:

I used DataFrame.Merge method for 2 dataframes

DataFrame merge = left.Merge(right, "Int", "Int");

Left dataframe:

Int Long
0 0
1 1

Right dataframe:

Int Long
null null

  • What happened?

Incorrect merge results

Int_left Long_left Int_right Long_right
1 1 null null

  • What did you expect?

I expect that row with Int 0 value behave the same way as row with int = null bevaior

Int_left Long_left Int_right Long_right
0 0 null null
1 1 null null

Source code / logs

Unit test to check:

[Fact]
        public void TestMerge_2()
        {
            DataFrame left = MakeDataFrameWithAllMutableColumnTypes(2, false);
            DataFrame right = MakeDataFrameWithAllMutableColumnTypes(1);

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

            Assert.Equal(2, merge.Rows.Count);
            Assert.Equal(0, (int)merge.Columns["Int_left"][0]);
            Assert.Equal(1, (int)merge.Columns["Int_left"][1]);
        }

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions