Skip to content

Primitive DataFrame Column Clone method crashes with IEnumerable argument #6821

Description

@asmirnov82

public PrimitiveDataFrameColumn Clone(IEnumerable mapIndices) - crashes with System.ArgumentOutOfRangeException: 'rowIndex Parameter name: Index cannot be greater than the Column's Length' exception

Simple unti test:

[Fact]
public void TestNotNullableColumnCloneWithIndicesMapAsEnumerable()
{
    //Arrange
    var column = new Int32DataFrameColumn("Int column", values: new[] { 0, 5, 2, 4, 1, 3 });
    var indicesMap = new long[] { 0, 1, 2, 5, 3, 4 };

    //Act
    var clonedColumn = column.Clone(indicesMap);

    //Assert
    Assert.NotSame(column, clonedColumn);
    Assert.Equal(column.Name, clonedColumn.Name);
    Assert.Equal(column.DataType, clonedColumn.DataType);
    Assert.Equal(column.NullCount, clonedColumn.NullCount);
    Assert.Equal(indicesMap.Length, clonedColumn.Length);

    for (int i = 0; i < indicesMap.Length; i++)
        Assert.Equal(column[indicesMap[i]], clonedColumn[i]);
}

Activity

  1. ghost added
    untriagedNew issue has not been triaged
    on Sep 13, 2023
  2. ghost removed on Sep 27, 2023
  3. added a commit that references this issue on Sep 27, 2023
    7fe293d
  4. ghost removed
    untriagedNew issue has not been triaged
    on Sep 27, 2023
  5. added 2 commits that reference this issue on Oct 3, 2023
    5cf6051
    b48e9b7
  6. ghost locked as resolved and limited conversation to collaborators on Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions