Skip to content

Commit

Permalink
Add an allocate method for CategoricalArrays for DataStreams
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Sep 14, 2017
1 parent fb72599 commit 5488484
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/abstractdataframe/io.jl
Expand Up @@ -230,6 +230,8 @@ Data.streamtypes(::Type{DataFrame}) = [Data.Column, Data.Field]
Data.weakrefstrings(::Type{DataFrame}) = true

allocate(::Type{T}, rows, ref) where {T} = Vector{T}(rows)
allocate(::Type{T}, rows, ref) where {T <: Union{CategoricalValue, Null}} =
CategoricalArray{CategoricalArrays.unwrap_catvalue_type(T)}(rows)
allocate(::Type{T}, rows, ref) where {T <: Union{WeakRefString, Null}} =
WeakRefStringArray(ref, T, rows)

Expand Down

0 comments on commit 5488484

Please sign in to comment.