diff --git a/src/DataFrames.jl b/src/DataFrames.jl index 874c4d85c1..b7a071a3f4 100644 --- a/src/DataFrames.jl +++ b/src/DataFrames.jl @@ -31,7 +31,6 @@ export AbstractDataFrame, Tables, allowmissing!, antijoin, - by, columnindex, combine, completecases, @@ -72,9 +71,6 @@ export AbstractDataFrame, unstack, valuecols -# TODO: remove these exports in year 2021 -export by, aggregate - if VERSION >= v"1.1.0-DEV.792" import Base.eachcol, Base.eachrow else diff --git a/src/deprecated.jl b/src/deprecated.jl index 2de96d8be3..47d5585515 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -1,3 +1,5 @@ +export by, aggregate + by(args...; kwargs...) = throw(ArgumentError("by function was removed from DataFrames.jl. " * "Use the `combine(groupby(...), ...)` or `combine(f, groupby(...))` instead.")) diff --git a/src/other/precompile.jl b/src/other/precompile.jl index 7122f7b75e..da211ac8b9 100644 --- a/src/other/precompile.jl +++ b/src/other/precompile.jl @@ -1579,9 +1579,15 @@ function precompile(all=false) Base.precompile(Tuple{Reduce{typeof(max), Nothing, Nothing},Vector{Int},GroupedDataFrame{DataFrame}}) Base.precompile(Tuple{Type{OnCol},Vector{String},Vararg{AbstractVector{T} where T, N} where N}) - combine(groupby(DataFrame(), []), identity) - innerjoin(DataFrame(v1=[]), DataFrame(v1=[]), on=:v1) - outerjoin(DataFrame(v1=[]), DataFrame(v1=[]), on=:v1) + for v in ([1, 2], [2, 1], [2, 2, 1]), + op in (identity, x -> string.(x), x -> PooledArrays.PooledArray(string.(x))), + on in (:v1, [:v1, :v2]) + df = DataFrame(v1=op(v), v2=v) + combine(groupby(df, on), identity, :v1 => identity, + :v2 => ByRow(identity), :v2 => sum) + innerjoin(df, select(df, on), on=on) + outerjoin(df, select(df, on), on=on) + end end return nothing end