JuliaArrays / JuliaArrays/StructArrays.jl

append! doesn't follow AbstractArray interface, relies on Tables instead

Open
#278 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
402
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Found a bug in the append! function of StructArrays:

julia> using AxisKeys, StructArrays

# OK:
julia> append!(StructArray(a=[1,2]), [(a=3,),(a=4,)])
4-element StructArray(::Vector{Int64}) with eltype NamedTuple{(:a,), Tuple{Int64}}:
...

# error:
julia> append!(StructArray(a=[1,2]), KeyedArray([(a=3,),(a=4,)], 1:2))
ERROR: type NamedTuple has no field a

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the StructArrays append! entry point and run the Julia reproducer comparing a plain vector of named tuples with the KeyedArray input. Trace why the KeyedArray path produces a NamedTuple field error; done means append! accepts that AbstractArray input consistently with the plain vector case.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.