JuliaData / JuliaData/PooledArrays.jl
`map` applies function to unused pool levels
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 49
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
map applies the function to all values in the pool, whether they are used or not. This is notably a problem if you replace missing values:
julia> x = PooledArray([missing, 1])
2-element PooledArray{Union{Missing, Int64},UInt8,1,Array{UInt8,1}}:
missing
1
julia> x[1] = 0
0
julia> map(Int, x)
ERROR: MethodError: no method matching Int64(::Missing)
This is a difficult problem to fix, as it would require going over all values to check which ones are not used. One possibility would be to wrap the call in try... catch, store a special value in case of error, and check at the end whether that value was used. If so, call the function again to trigger the error.
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 at the map entry point and reproduce the PooledArray example showing that an unused missing level still reaches Int. Determine how used and unused pool levels are distinguished; done means map skips unused levels while still surfacing errors for values that are actually used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100