JuliaCollections / JuliaCollections/DataStructures.jl
Merge on DefaultOrderedDicts should call the ordered merge function
Open
Nobody has claimed this yet.
bug
- Dominant language
- Julia
- Stars
- 745
- Forks
- 261
- PR merge metrics
- No merged PRs in 30d
Description
julia> d = DefaultOrderedDict{String, Vector{UInt16}}(Vector{UInt16});
julia> d2 = DefaultOrderedDict{String, Vector{UInt16}}(Vector{UInt16});
julia> @which merge(d, d2)
merge(d::AbstractDict, others::AbstractDict...) in Base at abstractdict.jl:311
julia> @which merge(OrderedDict(d), OrderedDict(d2))
merge(d::OrderedDict, others::AbstractDict...) in OrderedCollections at /home/tlnagy/.julia/packages/OrderedCollections/PRayh/src/ordered_dict.jl:466
Because the regular dict merge function is called the order is lost when merging two DefaultOrderedDicts.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the two DefaultOrderedDict examples and inspect the merge dispatch shown by @which. Compare it with the OrderedDict merge implementation in ordered_dict.jl; done means merging DefaultOrderedDicts preserves their order instead of using the regular dict merge.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100