Skip to content

Commit

Permalink
avoid depwarn in eachcol (#1614)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored and nalimilan committed Dec 4, 2018
1 parent dcac4bc commit f0efb17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export AbstractDataFrame,
disallowmissing!,
dropmissing,
dropmissing!,
eachcol,
eachrow,
eltypes,
groupby,
insertcols!,
Expand All @@ -58,6 +56,11 @@ export AbstractDataFrame,
unstack,
permutecols!

if VERSION >= v"1.1.0-DEV.792"
import Base.eachcol, Base.eachrow
else
export eachcol, eachrow
end

##############################################################################
##
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/abstractdataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ dump(df)
function Base.dump(io::IO, df::AbstractDataFrame, n::Int, indent)
println(io, typeof(df), " $(nrow(df)) observations of $(ncol(df)) variables")
if n > 0
for (name, col) in eachcol(df)
for (name, col) in eachcol(df, true)
print(io, indent, " ", name, ": ")
dump(io, col, n - 1, string(indent, " "))
end
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function getmaxwidths(df::AbstractDataFrame,
undefstrwidth = ourstrwidth(Base.undef_ref_str)

j = 1
for (name, col) in eachcol(df)
for (name, col) in eachcol(df, true)
# (1) Consider length of column name
maxwidth = ourstrwidth(name)

Expand Down

0 comments on commit f0efb17

Please sign in to comment.