Skip to content

Commit

Permalink
Bk/clean exports (#2720)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored Apr 15, 2021
1 parent 67ccc07 commit ff0d799
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export AbstractDataFrame,
Tables,
allowmissing!,
antijoin,
by,
columnindex,
combine,
completecases,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
@@ -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."))

Expand Down
12 changes: 9 additions & 3 deletions src/other/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ff0d799

Please sign in to comment.