Open
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.
Metadata
Metadata
Assignees
Labels
No labels