From ac199b0e377502ea0f1fa5ced7fda897a01b82a9 Mon Sep 17 00:00:00 2001 From: Joao Aparicio Date: Tue, 30 Jan 2024 11:37:51 -0600 Subject: [PATCH] Bugfix type instability in length(::Arrow.ToList) (#497) Co-authored-by: Ben Baumgold <4933671+baumgold@users.noreply.github.com> --- Project.toml | 2 +- src/arraytypes/list.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 1e3ffe3c..b283dc9f 100644 --- a/Project.toml +++ b/Project.toml @@ -17,7 +17,7 @@ name = "Arrow" uuid = "69666777-d1a9-59fb-9406-91d4454c9d45" authors = ["quinnj "] -version = "2.7.0" +version = "2.7.1" [deps] ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" diff --git a/src/arraytypes/list.jl b/src/arraytypes/list.jl index 8e2a1afd..41ac66f9 100644 --- a/src/arraytypes/list.jl +++ b/src/arraytypes/list.jl @@ -130,7 +130,7 @@ function ToList(input; largelists::Bool=false) end Base.IndexStyle(::Type{<:ToList}) = Base.IndexLinear() -Base.size(x::ToList) = (length(x.inds) == 0 ? 0 : x.inds[end],) +Base.size(x::ToList{T,S,A,I}) where {T,S,A,I} = (isempty(x.inds) ? zero(I) : x.inds[end],) function Base.pointer(A::ToList{UInt8}, i::Integer) chunk = searchsortedfirst(A.inds, i)