Skip to content

Commit 011a9b8

Browse files
committed
Merge remote-tracking branch 'origin/master' into nl/threadedgrouping
2 parents 3e225ad + 86a5ee6 commit 011a9b8

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/abstractdataframe/abstractdataframe.jl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ end
10231023

10241024
_filter_helper(f, cols...)::BitVector = ((x...) -> f(x...)::Bool).(cols...)
10251025

1026-
@inline function Base.filter((cols, f)::Pair{<:AsTable}, df::AbstractDataFrame;
1026+
@inline function Base.filter((cols, f)::Pair{AsTable}, df::AbstractDataFrame;
10271027
view::Bool=false)
10281028
df_tmp = select(df, cols.cols, copycols=false)
10291029
if ncol(df_tmp) == 0
@@ -1547,14 +1547,15 @@ Base.vcat(dfs::AbstractDataFrame...;
15471547
AbstractVector{<:AbstractString}}=:setequal) =
15481548
reduce(vcat, dfs; cols=cols)
15491549

1550-
Base.reduce(::typeof(vcat),
1551-
dfs::Union{AbstractVector{<:AbstractDataFrame},
1552-
Tuple{Vararg{AbstractDataFrame}}};
1553-
cols::Union{Symbol, AbstractVector{Symbol},
1554-
AbstractVector{<:AbstractString}}=:setequal) =
1555-
_vcat([df for df in dfs if ncol(df) != 0]; cols=cols)
1550+
function Base.reduce(::typeof(vcat),
1551+
dfs::Union{AbstractVector{<:AbstractDataFrame},
1552+
Tuple{AbstractDataFrame, Vararg{AbstractDataFrame}}};
1553+
cols::Union{Symbol, AbstractVector{Symbol},
1554+
AbstractVector{<:AbstractString}}=:setequal)
1555+
return _vcat(AbstractDataFrame[df for df in dfs if ncol(df) != 0]; cols=cols)
1556+
end
15561557

1557-
function _vcat(dfs::AbstractVector{<:AbstractDataFrame};
1558+
function _vcat(dfs::AbstractVector{AbstractDataFrame};
15581559
cols::Union{Symbol, AbstractVector{Symbol},
15591560
AbstractVector{<:AbstractString}}=:setequal)
15601561

@@ -1586,13 +1587,15 @@ function _vcat(dfs::AbstractVector{<:AbstractDataFrame};
15861587

15871588
if !isempty(coldiff)
15881589
# if any DataFrames are a full superset of names, skip them
1589-
filter!(u -> !issetequal(u, header), uniqueheaders)
1590+
let header=header # julia #15276
1591+
filter!(u -> !issetequal(u, header), uniqueheaders)
1592+
end
15901593
estrings = map(enumerate(uniqueheaders)) do (i, head)
15911594
matching = findall(h -> head == h, allheaders)
15921595
headerdiff = setdiff(coldiff, head)
1593-
cols = join(headerdiff, ", ", " and ")
1596+
badcols = join(headerdiff, ", ", " and ")
15941597
args = join(matching, ", ", " and ")
1595-
return "column(s) $cols are missing from argument(s) $args"
1598+
return "column(s) $badcols are missing from argument(s) $args"
15961599
end
15971600
throw(ArgumentError(join(estrings, ", ", ", and ")))
15981601
end

src/other/index.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ Base.@propagate_inbounds SubIndex(parent::AbstractIndex, cols) =
422422
SubIndex(parent, parent[cols])
423423

424424
Base.length(x::SubIndex) = length(x.cols)
425-
Base.names(x::SubIndex) = string.(_names(x))
425+
Base.names(x::SubIndex) = string.(_names(x))::Vector{String}
426426
_names(x::SubIndex) = view(_names(x.parent), x.cols)
427427

428428
function Base.haskey(x::SubIndex, key::Symbol)

0 commit comments

Comments
 (0)