JuliaData / Feather.jl

Read and write feather files in pure Julia
https://juliadata.github.io/Feather.jl/stable
Other
109 stars 27 forks source link

Example does not run #50

Closed Rudi79 closed 7 years ago

Rudi79 commented 7 years ago

Hi, I try to run:

using Feather  
df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"])
Feather.write("shiny_new_feather_file.feather", df)

It fails with: ArgumentError: source doesn't support the supported streaming types of sink: DataType[DataStreams.Data.Column, DataStreams.Data.Field]

I don't understand why this small code snippet isn't working. Any help is appreciated.

ararslan commented 7 years ago

Hey @Rudi79, could you post your versioninfo() and Pkg.status("Feather")?

Rudi79 commented 7 years ago

Sure: Julia Version 0.6.0 Commit 903644385b* (2017-06-19 13:05 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NOAFFINITY Haswell) LAPACK: libopenblas64 LIBM: libopenlibm LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

Pkg.status("Feather"):

I also run a Pkg.test("Feather"):

INFO: Computing test dependencies for Feather... INFO: Installing DataStreamsIntegrationTests v0.0.2 INFO: Testing Feather WARNING: Method definition ==(Base.Nullable{S}, Base.Nullable{T}) in module Base at nullable.jl:238 overwritten in module NullableArrays at C:\Users\xxx.julia\v0.6\NullableArrays\src\operators.jl:99. WARNING: This Feather file is old and will not be readable beyond the 0.3.0 release ERROR: LoadError: TypeError: Tuple: in parameter, expected Type, got String Stacktrace:

[1] DataStreams.Data.Schema(::Array{String,1}, ::Array{DataType,1}, ::Int64, ::Dict{Any,Any}) at C:\Users\xxx.julia\v0.6\DataStreams\src\DataStreams.jl:62 [2] #Source#5(::Bool, ::Bool, ::Bool, ::Type{T} where T, ::String) at C:\Users\xxx.julia\v0.6\Feather\src\Feather.jl:114 [3] Feather.Source(::String) at C:\Users\xxx.julia\v0.6\Feather\src\Feather.jl:89 [4] macro expansion at C:\Users\xxx.julia\v0.6\Feather\test\runtests.jl:18 [inlined] [5] anonymous at .\:? [6] include_from_node1(::String) at .\loading.jl:569 [7] include(::String) at .\sysimg.jl:14 [8] process_options(::Base.JLOptions) at .\client.jl:305 [9] _start() at .\client.jl:371 while loading C:\Users\xxx.julia\v0.6\Feather\test\runtests.jl, in expression starting on line 17 ===============================[ ERROR: Feather ]===============================

failed process: Process('C:\Users\xxx\AppData\Local\Julia-0.6.0\bin\julia.exe' -Cnative '-JC:\Users\xxx\AppData\Local\Julia-0.6.0\lib\julia\sys.dll' --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=no --compilecache=yes 'C:\Users\xxx\.julia\v0.6\Feather\test\runtests.jl', ProcessExited(1)) [1]

================================================================================ INFO: Removing DataStreamsIntegrationTests v0.0.2 Base.Pkg.Entry.PkgTestError("Feather had test errors") in test at base\pkg\pkg.jl:276 in #test#3 at base\pkg\pkg.jl:276 in at base\ in #cd#1 at base\pkg\dir.jl:36 in cd at base\file.jl:59 in at base\pkg\dir.jl:36 in at base\ in #test#62 at base\pkg\entry.jl:757

Thx for looking into this issue. Best, Rudi

quinnj commented 7 years ago

This now works on current master; sorry if things got a little out of sink

julia> using Feather, DataFrames

julia> df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"])
4×2 DataFrames.DataFrame
│ Row │ A │ B │
├─────┼───┼───┤
│ 1   │ 1 │ M │
│ 2   │ 2 │ F │
│ 3   │ 3 │ F │
│ 4   │ 4 │ M │

julia> Feather.write("shiny_new_feather_file.feather", df)
Feather.Sink{DataFrames.DataFrameStream{Tuple{Array{Int64,1},Array{String,1}}}}(Feather.Metadata.CTable("", 4, Feather.Metadata.Column[Feather.Metadata.Column("A", Feather.Metadata.PrimitiveArray(INT64, PLAIN, 8, 4, 0, 32), 0, nothing, ""), Feather.Metadata.Column("B", Feather.Metadata.PrimitiveArray(UTF8, PLAIN, 40, 4, 0, 32), 0, nothing, "")], 2, ""), "shiny_new_feather_file.feather", IOBuffer(data=UInt8[...], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1), "", "", DataFrames.DataFrameStream{Tuple{Array{Int64,1},Array{String,1}}}(([1, 2, 3, 4], String["M", "F", "F", "M"]), String["A", "B"]))