Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with reading string column in a feather file #109

Closed
rsrock opened this issue Jan 4, 2019 · 6 comments
Closed

Error with reading string column in a feather file #109

rsrock opened this issue Jan 4, 2019 · 6 comments

Comments

@rsrock
Copy link

rsrock commented Jan 4, 2019

I have a feather file that is giving me the following error in a fresh Julia session:

julia> using Feather

julia> Feather.read("test/fourspots.feather")
ERROR: MethodError: Cannot `convert` an object of type Nothing to an object of type String
Closest candidates are:
  convert(::Type{String}, ::Union{CategoricalString{R}, CategoricalValue{T,R} where T} where R) at /Users/rrock/.julia/packages/CategoricalArrays/ucKV2/src/value.jl:82
  convert(::Type{String}, ::WeakRefStrings.WeakRefString) at /Users/rrock/.julia/packages/WeakRefStrings/lXDgV/src/WeakRefStrings.jl:72
  convert(::Type{T<:AbstractString}, ::T<:AbstractString) where T<:AbstractString at strings/basic.jl:207
  ...
Stacktrace:
 [1] Feather.Metadata.CTable(::Nothing, ::Int64, ::Array{Feather.Metadata.Column,1}, ::Int32, ::Nothing) at /Users/rrock/.julia/packages/Feather/tppUH/src/metadata.jl:61
 [2] read(::FlatBuffers.Table{Feather.Metadata.CTable}, ::Type{Feather.Metadata.CTable}) at /Users/rrock/.julia/packages/FlatBuffers/YAnlP/src/FlatBuffers.jl:320
 [3] read at /Users/rrock/.julia/packages/FlatBuffers/YAnlP/src/FlatBuffers.jl:300 [inlined]
 [4] read at /Users/rrock/.julia/packages/FlatBuffers/YAnlP/src/FlatBuffers.jl:323 [inlined]
 [5] getctable(::Array{UInt8,1}) at /Users/rrock/.julia/packages/Feather/tppUH/src/loadfile.jl:38
 [6] #Source#4(::Bool, ::Type, ::String) at /Users/rrock/.julia/packages/Feather/tppUH/src/source.jl:18
 [7] Type at ./none:0 [inlined]
 [8] #read#7(::Bool, ::Function, ::String) at /Users/rrock/.julia/packages/Feather/tppUH/src/source.jl:68
 [9] read(::String) at /Users/rrock/.julia/packages/Feather/tppUH/src/source.jl:68
 [10] top-level scope at none:0

The feather file opens without any problems in R. I assume the issue is with a single column containing string UUIDs, because all other columns are of doubles. I don't see anything obvious that's wrong with the file (there are no NA or Nothing entries in the UUID column, for example).

This is with Feather v0.5.1, and Arrow v0.2.3

@ExpandingMan
Copy link
Collaborator

ExpandingMan commented Jan 4, 2019

I'm pretty sure this is a Flatbuffers issue since it is coming from a call to FlatBuffers.read. Could you make sure that you have the most recent version of FlatBuffers?

@quinnj , any thoughts on the FlatBuffers end of this? It seems that all of the strings getting passed to the CTable constructor are nothing instead.

@quinnj
Copy link
Member

quinnj commented Jan 4, 2019

@rjkat has done some overhauling recently of FlatBuffers.jl; perhaps he has an idea what's going on.

@rjkat
Copy link

rjkat commented Jan 5, 2019

This is related to the behaviour of default values for string fields. In 0.5 they changed from "" to nothing. It seems like Feather.jl was relying on this behaviour but there were no explicit tests for it. I've tagged FlatBuffers 0.5.2 which reverts back to the old behaviour, hopefully once the release makes it into METADATA that should address this problem.

@ExpandingMan
Copy link
Collaborator

Great thanks. Of course, please let us know if something will ultimately need to be changed.

@rsrock
Copy link
Author

rsrock commented Jan 7, 2019

That may have fixed it. I'm hitting another error, but I think it's unrelated. I'll investigate a bit before closing this issue. Thanks.

@rsrock
Copy link
Author

rsrock commented Feb 1, 2019

Confirmed, this is now fixed. Thanks!

@rsrock rsrock closed this as completed Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants