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

[BUG]: Serialisation error for class with nullable struct with child property #495

Open
paulengineer opened this issue Apr 3, 2024 · 0 comments

Comments

@paulengineer
Copy link

Library Version

4.23.4

OS

Windows

OS Architecture

64 bit

How to reproduce?

  1. Add test below (possibly to ParquetSerializerTest.cs ?) and run

Failing test

private struct StructWithIntProp {
    public int id { get; set; }
}
private class ClassWithNullableCustomStruct {
    public StructWithIntProp? nullableStruct { get; set; }
}

[Fact]
public async Task Class_With_Nullable_Struct() {
    var data = new List<ClassWithNullableCustomStruct> {
        new ClassWithNullableCustomStruct() {
            nullableStruct = null
        }
    };

    using var ms = new MemoryStream();
    await ParquetSerializer.SerializeAsync(data, ms);

    ms.Position = 0;
    IList<ClassWithNullableCustomStruct> data2 = await ParquetSerializer.DeserializeAsync<ClassWithNullableCustomStruct>(ms);

    Assert.Equivalent(data2, data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant