Skip to content

conflict with CSV and GNNGraphs when running Flux.batch #104

Closed
@doyku

Description

@doyku

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

Activity

oysteinsolheim

oysteinsolheim commented on Jan 18, 2022

@oysteinsolheim
Contributor

see #98

doyku

doyku commented on Jan 18, 2022

@doyku
Author

ok. Given that issue is closed should I expect to add that line in the future or will a future version fix it?

CarloLucibello

CarloLucibello commented on Jan 18, 2022

@CarloLucibello
Member

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 out

doyku

doyku commented on Jan 18, 2022

@doyku
Author

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

CarloLucibello commented on Jan 18, 2022

@CarloLucibello
Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @CarloLucibello@oysteinsolheim@doyku

      Issue actions

        conflict with CSV and GNNGraphs when running Flux.batch · Issue #104 · JuliaGraphs/GraphNeuralNetworks.jl