Skip to content

Commit

Permalink
change eltype to true eltype in describe (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored and ararslan committed Jul 27, 2019
1 parent 2abf64c commit 94cd7ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/abstractdataframe/abstractdataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ function _describe(df::AbstractDataFrame, stats::AbstractVector)
d[:last] = isempty(col) ? nothing : last(col)
end

if :eltype in predefined_funs
d[:eltype] = eltype(col)
end

return d
end

Expand Down Expand Up @@ -485,10 +489,6 @@ function get_stats(col::AbstractVector, stats::AbstractVector{Symbol})
end
end

if :eltype in stats
d[:eltype] = eltype(col)
end

return d
end

Expand Down
4 changes: 2 additions & 2 deletions test/dataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ end
nmissing = [nothing, 1, nothing, 1, nothing, nothing],
first = [1, 1, "a", "a", Date(2000), 1],
last = [4, missing, "d", missing, Date(2004), 2],
eltype = [Int, Int, String, String, Date,
eltype(df[!, :catarray])])
eltype = [Int, Union{Missing, Int}, String,
Union{Missing, String}, Date, CategoricalValue{Int, UInt32}])

default_fields = [:mean, :min, :median, :max, :nunique, :nmissing, :eltype]

Expand Down

0 comments on commit 94cd7ad

Please sign in to comment.