Skip to content

Commit

Permalink
fix for Arrow 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Jan 25, 2024
1 parent 9a45862 commit 4814dae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/samples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 4814dae

Please sign in to comment.