Not every package that uses tables uses the Tables interface. Notably, the QueryVerse packages and the Julia VSCode plug-in all use the TableTraits interface instead, so it's useful to implement both.
Here is one way to implement the interface for DimensionalData, modeled after how DataFrames does it.
function IteratorInterfaceExtensions.getiterator(da::AbstractDimArray)
return Tables.datavaluerows(Tables.columntable(da))
end
IteratorInterfaceExtensions.isiterable(da::AbstractDimArray) = true
TableTraits.isiterabletable(da::AbstractDimArray) = true
function IteratorInterfaceExtensions.getiterator(ds::AbstractDimStack)
return Tables.datavaluerows(Tables.columntable(ds))
end
IteratorInterfaceExtensions.isiterable(ds::AbstractDimStack) = true
TableTraits.isiterabletable(ds::AbstractDimStack) = true
Not every package that uses tables uses the Tables interface. Notably, the QueryVerse packages and the Julia VSCode plug-in all use the TableTraits interface instead, so it's useful to implement both.
Here is one way to implement the interface for DimensionalData, modeled after how DataFrames does it.