Skip to content

Commit

Permalink
Fix CategoricalArray-related test failure (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan committed Apr 5, 2018
1 parent a99171e commit 8af9059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
julia 0.6
Missings 0.2.3
CategoricalArrays 0.3.5
CategoricalArrays 0.3.6
StatsBase 0.11.0
SortingAlgorithms
Reexport
Expand Down
8 changes: 4 additions & 4 deletions src/dataframe/dataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ function DataFrame(column_eltypes::AbstractVector{T}, cnames::AbstractVector{Sym
columns = Vector{Any}(undef, length(column_eltypes))
for (j, elty) in enumerate(column_eltypes)
if elty >: Missing
if Missings.T(elty) <: CategoricalValue
columns[j] = CategoricalArray{Union{Missings.T(elty).parameters[1], Missing}}(nrows)
if Missings.T(elty) <: CategoricalArrays.CatValue
columns[j] = CategoricalArray{elty}(undef, nrows)
else
columns[j] = missings(elty, nrows)
end
else
if elty <: CategoricalValue
columns[j] = CategoricalVector{elty}(nrows)
if elty <: CategoricalArrays.CatValue
columns[j] = CategoricalVector{elty}(undef, nrows)
else
columns[j] = Vector{elty}(undef, nrows)
end
Expand Down

0 comments on commit 8af9059

Please sign in to comment.