When trying to clean up the code using @code_warntype I get the type instability of ::AbstractArray{T,1} when it is not expected.
A data frame is the argument of the function FUNC1, and a particular COLUMN in it is used within the function. I've defined the type for this COLUMN within the function as Array{Float64,1}. But, when I run @code_warntype on the function, ::AbstractArray{T,1} appears in the output.
function FUNC1(df::DataFrame)
df_COL=df[:COLUMN]::Array{Float64,1}
.......
end
Expected result is that there should be no type instability because the type has been specified for that column.
Actual results:
Body::Tuple{Float64,Float64}
│ 159 1 ── %1 = invoke Base.getindex(_2::DataFrame, :COLUMN::Symbol)::AbstractArray{T,1} where T
│ │ (Core.typeassert)(%1, Array{Float64,1})
│ │ %3 = π (%1, Array{Float64,1})