rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
262 stars 38 forks source link

StackOverflow when constructing table from DimArray with single dimension #666

Closed sethaxen closed 3 months ago

sethaxen commented 3 months ago

This also appears when other packages like AlgebraOfGraphics use DimArray as a table source:

DimensionalData v0.25.8:

julia> using DimensionalData, Tables

julia> Tables.columntable(DimArray(1:5, X))
(X = [1, 2, 3, 4, 5], value = [1, 2, 3, 4, 5])

DimensionalData v0.26.2:

julia> Tables.columntable(DimArray(1:5, X))
(X = [Error showing value of type @NamedTuple{X::DimensionalData.DimExtensionArray{Int64, 1, Tuple{X{DimensionalData.Dimensions.Lookups.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, DimVector{Int64, Tuple{X{DimensionalData.Dimensions.Lookups.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, Base.OneTo{Int64}, DimensionalData.NoName, DimensionalData.Dimensions.Lookups.NoMetadata}}, value::UnitRange{Int64}}:
ERROR: StackOverflowError:
Stacktrace:
 [1] getindex(dg::DimensionalData.DimExtensionArray{Int64, 1, Tuple{…}, Tuple{}, DimVector{…}}, i::Int64) (repeats 79984 times)
   @ DimensionalData ~/.julia/packages/DimensionalData/C9h0Y/src/dimindices.jl:25
Some type information was truncated. Use `show(err)` to see complete types.
sethaxen commented 3 months ago

Thanks, @rafaqz for the fix! Did you mean to register a new release?

rafaqz commented 3 months ago

Yes I forgot! Go for it I cant from my phone.