Closed stefer closed 8 months ago
In 4.22.0, the Datafield.IsNullable was set to True for decimal? properties and those fields where exported as null in the files if the value was null.
There seem to be missing test cases for nullable decimals.
#r "nuget: NUnit, 4.0.1"
#r "nuget: Parquet.Net,4.22.0"
using Parquet.Serialization;
using Parquet.Serialization.Attributes;
using NUnit.Framework;
var stream = new MemoryStream();
var values = new [] {new Test {Value = 23, Value2 = 43}};
var result = await ParquetSerializer.SerializeAsync(values, stream).ConfigureAwait(false);
Assert.That(result.DataFields[0].IsNullable, Is.True);
Assert.That(result.DataFields[1].IsNullable, Is.False);
class Test {
public decimal? Value {get; set;}
public decimal Value2 {get; set;}
}
Thanks for raising this, seems to be regression after adding support for class fields. Just fixing and adding test coverage.
Fixed in the latest hotfix, feel free to try ;)
@aloneguid The same thing happens with the DateTime type in version 4.23.3. I think you should check all types :D
@aloneguid The same thing happens with the DateTime type in version 4.23.3. I think you should check all types :D
Thanks, that seems to be happening to all types that can have custom attributes. I have no idea how it worked before ;)
Possibly related to my issue: https://github.com/aloneguid/parquet-dotnet/issues/467
Hi, I can confirm that nullable decimal now works, but I also have problems with DateTime.
I added a preview PR here : https://github.com/aloneguid/parquet-dotnet/pull/468 Maybe it could be an inspiration to a solution.
other types are fixed in the latest release too :)
Thanks @aloneguid! I will try it soon :)
Thanks @aloneguid - it now works as expected.
Just encountered this issue with Timespan
Expression of type 'System.Nullable`1[System.TimeSpan]' cannot be used for parameter of type 'System.TimeSpan' of method 'Void Add(System.TimeSpan)' (Parameter 'arg0')
at System.Dynamic.Utils.ExpressionUtils.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, String methodParamName, String argumentParamName, Int32 index)
at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, Expression arg0)
at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, IEnumerable`1 arguments)
Library Version
4.23.0
OS
Windows/Linux
OS Architecture
64 bit
How to reproduce?
The following code throws exception when version 4.23.0 or larger is used.
Exception:
Stacktrace:
Failing test