-
Notifications
You must be signed in to change notification settings - Fork 11
Move DataTable sink for CSV/DataStreams to DataTables #35
Conversation
REQUIRE
Outdated
@@ -5,3 +5,6 @@ StatsBase 0.11.0 | |||
SortingAlgorithms | |||
Reexport | |||
Compat 0.19.0 | |||
WeakRefStrings | |||
CSV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually needed?
src/DataTables.jl
Outdated
@@ -17,7 +17,7 @@ import NullableArrays: dropnull, dropnull! | |||
@reexport using CategoricalArrays | |||
using GZip | |||
using SortingAlgorithms | |||
|
|||
using WeakRefStrings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to io.jl
so that it's clear where it's used?
src/abstractdatatable/io.jl
Outdated
|
||
############################################################################## | ||
# | ||
# CSV IO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only CSV, DataStreams.
src/abstractdatatable/io.jl
Outdated
Data.streamtype(::Type{DataTable}, ::Type{Data.Column}) = true | ||
Data.streamtype(::Type{DataTable}, ::Type{Data.Field}) = true | ||
|
||
Data.streamfrom{T <: AbstractVector}(source::DataTable, ::Type{Data.Column}, ::Type{T}, col) = (@inbounds A = source.columns[col]::T; return A) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please wrap long lines.
src/abstractdatatable/io.jl
Outdated
# DataTables DataStreams implementation | ||
function Data.schema(df::DataTable, ::Type{Data.Column}) | ||
return Data.Schema(map(string, names(df)), | ||
DataType[typeof(A) for A in df.columns], size(df, 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect alignment.
src/abstractdatatable/io.jl
Outdated
allocate{S,R}(::Type{Nullable{CategoricalArrays.CategoricalValue{S,R}}}, rows, ref) = NullableCategoricalArray{S,1,R}(rows) | ||
allocate{S,R}(::Type{NullableCategoricalVector{S,R}}, rows, ref) = NullableCategoricalArray{S,1,R}(rows) | ||
|
||
if isdefined(Main, :DataArray) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this won't play well with precompilation?
These changes alone would be sufficient to support DataTables without making any changes in DataStreams, CSV, or DataFrames, right? I can use |
FYI, definitely still on board w/ the DataStreams refactoring, I'm just trying to get new tags out for packages before merging all the refactorings (that way they all have at least one tag that works for 0.6 before more major upheaval). |
Pulled this locally to try out and kick the tires. It's actually pretty straightforward, just porting the code over from DataStreams and updating for DataTables. It's nice too because this doesn't require any changes to DataStreams or DataFrames. I did throw in a quick test and updates the REQUIRES and test/REQUIRES. |
Thanks Jacob! |
No description provided.