Skip to content

allow push!/pushfirst!/append!/prepend! with multiple values #2517

allow push!/pushfirst!/append!/prepend! with multiple values

allow push!/pushfirst!/append!/prepend! with multiple values #2517

Triggered via pull request September 3, 2023 21:18
Status Failure
Total duration 1h 23m 28s
Artifacts

ci.yml

on: pull_request
Documentation
8m 8s
Documentation
Matrix: test
Fit to window
Zoom out
Zoom in

Annotations

7 errors and 5 warnings
Documentation: src/dataframe/insertion.jl#L563
doctest failure in ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:563-641 ```jldoctest julia> df = DataFrame(A='a':'c', B=1:3) 3×2 DataFrame Row │ A B │ Char Int64 ─────┼───────────── 1 │ a 1 2 │ b 2 3 │ c 3 julia> pushfirst!(df, (true, false), promote=true) 4×2 DataFrame Row │ A B │ Any Int64 ─────┼───────────── 1 │ true 0 2 │ a 1 3 │ b 2 4 │ c 3 julia> pushfirst!(df, df[1, :]) 5×2 DataFrame Row │ A B │ Any Int64 ─────┼───────────── 1 │ true 0 2 │ true 0 3 │ a 1 4 │ b 2 5 │ c 3 julia> pushfirst!(df, (C="something", A=11, B=12), cols=:intersect) 6×2 DataFrame Row │ A B │ Any Int64 ─────┼───────────── 1 │ 11 12 2 │ true 0 3 │ true 0 4 │ a 1 5 │ b 2 6 │ c 3 julia> pushfirst!(df, Dict(:A=>1.0, :C=>1.0), cols=:union) 7×3 DataFrame Row │ A B C │ Any Int64? Float64? ─────┼────────────────────────── 1 │ 1.0 missing 1.0 2 │ 11 12 missing 3 │ true 0 missing 4 │ true 0 missing 5 │ a 1 missing 6 │ b 2 missing 7 │ c 3 missing julia> pushfirst!(df, NamedTuple(), cols=:subset) 8×3 DataFrame Row │ A B C │ Any Int64? Float64? ─────┼───────────────────────────── 1 │ missing missing missing 2 │ 1.0 missing 1.0 3 │ 11 12 missing 4 │ true 0 missing 5 │ true 0 missing 6 │ a 1 missing 7 │ b 2 missing 8 │ c 3 missing julia> pushfirst!(DataFrame(a=1, b=2), (3, 4), (b=6, a=5)) 3×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 3 4 2 │ 5 6 3 │ 1 2 ``` Subexpression: pushfirst!(DataFrame(a=1, b=2), (3, 4), (b=6, a=5)) Evaluated output: ERROR: ArgumentError: Mixing rows with column names and without column names in a single `push!` call is not allowed Stacktrace: [1] pushfirst!(df::DataFrame, rows::ByRow{Tuple{Tuple{Int64, Int64}, NamedTuple{(:b, :a), Tuple{Int64, Int64}}}}; cols::Symbol, promote::Bool) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1129 [2] pushfirst!(::DataFrame, ::Any, ::Vararg{Any}; cols::Symbol, promote::Bool) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1138 [3] pushfirst!(::DataFrame, ::Any, ::Any) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1138 [4] top-level scope @ none:1 Expected output: 3×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 3 4 2 │ 5 6 3 │ 1 2 diff = Warning: Diff output requires color. 3×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 3 4 2 │ 5 6 3 │ 1 2ERROR: ArgumentError: Mixing rows with column names and without column names in a single `push!` call is not allowed Stacktrace: [1] pushfirst!(df::DataFrame, rows::ByRow{Tuple{Tuple{Int64, Int64}, NamedTuple{(:b, :a), Tuple{Int64, Int64}}}}; cols::Symbol, promote::Bool) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1129 [2] pushfirst!(::DataFrame, ::Any, ::Vararg{Any}; cols::Symbol, promote::Bool) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1138 [3] pushfirst!(::DataFrame, ::Any, ::Any) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1138 [4] top-level scope @ none:1
Documentation: src/dataframe/insertion.jl#L458
doctest failure in ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:458-536 ```jldoctest julia> df = DataFrame(A='a':'c', B=1:3) 3×2 DataFrame Row │ A B │ Char Int64 ─────┼───────────── 1 │ a 1 2 │ b 2 3 │ c 3 julia> push!(df, (true, false), promote=true) 4×2 DataFrame Row │ A B │ Any Int64 ─────┼───────────── 1 │ a 1 2 │ b 2 3 │ c 3 4 │ true 0 julia> push!(df, df[1, :]) 5×2 DataFrame Row │ A B │ Any Int64 ─────┼───────────── 1 │ a 1 2 │ b 2 3 │ c 3 4 │ true 0 5 │ a 1 julia> push!(df, (C="something", A=11, B=12), cols=:intersect) 6×2 DataFrame Row │ A B │ Any Int64 ─────┼───────────── 1 │ a 1 2 │ b 2 3 │ c 3 4 │ true 0 5 │ a 1 6 │ 11 12 julia> push!(df, Dict(:A=>1.0, :C=>1.0), cols=:union) 7×3 DataFrame Row │ A B C │ Any Int64? Float64? ─────┼────────────────────────── 1 │ a 1 missing 2 │ b 2 missing 3 │ c 3 missing 4 │ true 0 missing 5 │ a 1 missing 6 │ 11 12 missing 7 │ 1.0 missing 1.0 julia> push!(df, NamedTuple(), cols=:subset) 8×3 DataFrame Row │ A B C │ Any Int64? Float64? ─────┼───────────────────────────── 1 │ a 1 missing 2 │ b 2 missing 3 │ c 3 missing 4 │ true 0 missing 5 │ a 1 missing 6 │ 11 12 missing 7 │ 1.0 missing 1.0 8 │ missing missing missing julia> push!(DataFrame(a=1, b=2), (3, 4), (b=6, a=5)) 3×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 1 2 2 │ 3 4 3 │ 5 6 ``` Subexpression: push!(DataFrame(a=1, b=2), (3, 4), (b=6, a=5)) Evaluated output: ┌ Error: Error adding value to column :a. Maybe you forgot passing `promote=true`? └ @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:810 ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64, Int64} to an object of type Int64 Closest candidates are: convert(::Type{T}, !Matched::Ptr) where T<:Integer @ Base pointer.jl:23 convert(::Type{T}, !Matched::Base.TwicePrecision) where T<:Number @ Base twiceprecision.jl:273 convert(::Type{T}, !Matched::AbstractChar) where T<:Number @ Base char.jl:185 ... Stacktrace: [1] push!(a::Vector{Int64}, item::Tuple{Int64, Int64}) @ Base ./array.jl:1060 [2] _row_inserter!(df::DataFrame, loc::Int64, row::Tuple{Tuple{Int64, Int64}, NamedTuple{(:b, :a), Tuple{Int64, Int64}}}, mode::Val{:push}, promote::Bool) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:776 [3] #push!#358 @ ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:545 [inlined] [4] push!(::DataFrame, ::Any, ::Vararg{Any}; cols::Symbol, promote::Bool) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1119 [5] push!(::DataFrame, ::Any, ::Any) @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:1119 [6] top-level scope @ none:1 Expected output: 3×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 1 2 2 │ 3 4 3 │ 5 6 diff = Warning: Diff output requires color. 3×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 1 2 2 │ 3 4 3 │ 5 6┌ Error: Error adding value to column :a. Maybe you forgot passing `promote=true`? └ @ DataFrames ~/work/DataFrames.jl/DataFrames.jl/src/dataframe/insertion.jl:810 ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64, Int64} to an object of type Int64 Closest candidates are: convert(::Type{T}, !Matched::Ptr) where T<:Integer @ Base pointer.jl:23 convert(::Type{T}, !Matched::Base.TwicePrecision) where T<:Number @ B
Documentation
Process completed with exit code 1.
Julia nightly - ubuntu-latest - x64 - pull_request
Process completed with exit code 1.
Julia 1 - ubuntu-latest - x64 - pull_request
Process completed with exit code 1.
Julia 1.6 - ubuntu-latest - x64 - pull_request
Process completed with exit code 1.
Julia 1 - windows-latest - x86 - pull_request
Process completed with exit code 1.
Documentation
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Julia nightly - ubuntu-latest - x64 - pull_request
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Julia 1 - ubuntu-latest - x64 - pull_request
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Julia 1.6 - ubuntu-latest - x64 - pull_request
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Julia 1 - windows-latest - x86 - pull_request
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/