Closed
Description
The issue comes from
sort(collect(keys(x1))) == sort(collect(keys(x2))) || @error "cannot concatenate feature data with different keys"
because Julia does not know which version of defalg to use for the sorting algorithm since InlineStrings (loaded by CSV) has a version of defalg that is compatible with this line.
Adding this line: Base.Sort.defalg(x::AbstractArray{<:Missing}) = QuickSort
resolved the ambiguity and allowed Flux.batch to run
Metadata
Metadata
Assignees
Labels
No labels
Activity
oysteinsolheim commentedon Jan 18, 2022
see #98
doyku commentedon Jan 18, 2022
ok. Given that issue is closed should I expect to add that line in the future or will a future version fix it?
CarloLucibello commentedon Jan 18, 2022
Technically this should be fixed in julia itself (see JuliaLang/julia#43426), but since that may take long and this problem pops up frequently we better add a workaround here. Unfortunately, we cannot define
Base.Sort.defalg(x::AbstractArray{<:Missing}) = QuickSort
in this repo, since it would be piracy. I'll try to figure something outdoyku commentedon Jan 18, 2022
Not sure what you mean by it being Piracy. It looks like Inline strings has this sort of line:
https://github.com/JuliaStrings/InlineStrings.jl/blob/main/src/InlineStrings.jl#L698
Base.Sort.defalg(::AbstractArray{<:Union{SmallInlineStrings, Missing}}) = InlineStringSort
CarloLucibello commentedon Jan 18, 2022
https://docs.julialang.org/en/v1/manual/style-guide/#:~:text=%22Type%20piracy%22%20refers%20to%20the,piracy%20with%20little%20ill%20effect.