From 4814daea4040fb44995a9f969a3e7f259642047a Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Thu, 25 Jan 2024 15:53:03 -0600 Subject: [PATCH] fix for Arrow 2.7 --- src/samples.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/samples.jl b/src/samples.jl index f5fe8027..5c8b9891 100644 --- a/src/samples.jl +++ b/src/samples.jl @@ -576,7 +576,13 @@ function Arrow.ArrowTypes.JuliaType(::Val{SAMPLES_ARROW_NAME}, ::Type{<:SamplesA end function Arrow.ArrowTypes.fromarrow(::Type{<:Samples}, arrow_data, arrow_info, arrow_encoded) - info = Arrow.ArrowTypes.fromarrow(SamplesInfoV2, arrow_info...) + info = Arrow.ArrowTypes.fromarrow(SamplesInfoV2, arrow_info) data = reshape(arrow_data, (channel_count(info), :)) return Samples(data, info, arrow_encoded) end + +# XXX in Arrow 2.7, the extra indirection with `fromarrowstruct` leads to the named tuple +# being splatted as positional arguments and not keyword args unless we add this method. +# The splatting leads to a method error because SamplesInfoV2 doesn't have a positional +# contructor, just a constructor from a row or from kwargs +Arrow.ArrowTypes.fromarrow(::Type{SamplesInfoV2}, x::NamedTuple) = SamplesInfoV2(x)