Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type piracy of reduce(vcat) #3456

Closed
MasonProtter opened this issue Aug 14, 2024 · 1 comment · Fixed by #3457
Closed

Type piracy of reduce(vcat) #3456

MasonProtter opened this issue Aug 14, 2024 · 1 comment · Fixed by #3457
Labels
Milestone

Comments

@MasonProtter
Copy link

MasonProtter commented Aug 14, 2024

DataFrames.jl is commiting type piracy on reduce(vcat):

julia> reduce(vcat, Union{}[]; init=Int[])
Int64[]

julia> using DataFrames

julia> reduce(vcat, Union{}[]; init=Int[])
ERROR: TypeError: in keyword argument init, expected AbstractDataFrame, got a value of type Vector{Int64}
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

julia> @which reduce(vcat, Union{}[]; init=Int[])
kwcall(::NamedTuple, ::typeof(reduce), ::typeof(vcat), dfs::Union{Tuple{AbstractDataFrame, Vararg{AbstractDataFrame}}, AbstractVector{<:AbstractDataFrame}})
     @ DataFrames ~/.julia/packages/DataFrames/58MUJ/src/abstractdataframe/abstractdataframe.jl:1868

This causes real errors in other packages, notably: SciML/ModelingToolkit.jl#2965

@bkamins
Copy link
Member

bkamins commented Aug 17, 2024

Fixed in #3457

@bkamins bkamins added the bug label Aug 17, 2024
@bkamins bkamins added this to the 1.7 milestone Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants