From 2107818e4a480c058e517a558b71a24678785555 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Thu, 5 Feb 2026 10:16:54 +0100 Subject: [PATCH] Fix `ToArrow` with non-one-based indices This generates errors with `CategoricalArray` due to its internal `CategoricalRefPool` type. Also drop `eltype`, which isn't needed as there is an `AbstractArray` fallback. --- src/ArrowTypes/src/ArrowTypes.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ArrowTypes/src/ArrowTypes.jl b/src/ArrowTypes/src/ArrowTypes.jl index fe2223f..50f80ca 100644 --- a/src/ArrowTypes/src/ArrowTypes.jl +++ b/src/ArrowTypes/src/ArrowTypes.jl @@ -420,9 +420,10 @@ function ToArrow(x::A) where {A} return ToArrow{T,A}(x) end -Base.IndexStyle(::Type{<:ToArrow}) = Base.IndexLinear() -Base.size(x::ToArrow) = (length(x.data),) -Base.eltype(::Type{TA}) where {T,A,TA<:ToArrow{T,A}} = T +Base.IndexStyle(::Type{<:ToArrow{<:Any,A}}) where {A} = Base.IndexStyle(A) +Base.size(x::ToArrow) = size(x.data) +Base.axes(x::ToArrow) = axes(x.data) + function _convert(::Type{T}, x) where {T} if x isa T return x