frictionlessdata / DataPackage.jl

A Julia library for working with Data Package.
MIT License
10 stars 3 forks source link

ERROR: MethodError: Cannot `convert` an object of type Nothing to an object of type String #21

Open scls19fr opened 4 years ago

scls19fr commented 4 years ago

Hello,

Reading DataPackage country list seems to raise an issue with this library

julia> using DataPackage

julia> data_url = "https://raw.githubusercontent.com/datasets/country-list/master/datapackage.json"
"https://raw.githubusercontent.com/datasets/country-list/master/datapackage.json"

julia> package = Package(data_url)
ERROR: MethodError: Cannot `convert` an object of type Nothing to an object of type String
Closest candidates are:
  convert(::Type{T<:AbstractString}, ::T<:AbstractString) where T<:AbstractString at strings/basic.jl:208
  convert(::Type{T<:AbstractString}, ::AbstractString) where T<:AbstractString at strings/basic.jl:209
  convert(::Type{T}, ::T) where T at essentials.jl:167
Stacktrace:
 [1] (::getfield(DataPackage, Symbol("##Resource#1#3")))(::Bool, ::Type{Resource}, ::Dict{String,Any}) at /Users/scls/.julia/dev/DataPackage/src/resource.jl:28
 [2] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:strict,),Tuple{Bool}}, ::Type{Resource}, ::Dict{String,Any}) at ./none:0
 [3] Package(::Dict{String,Any}, ::Bool) at /Users/scls/.julia/dev/DataPackage/src/package.jl:17
 [4] Package(::String, ::Bool) at /Users/scls/.julia/dev/DataPackage/src/package.jl:25 (repeats 2 times)
 [5] top-level scope at REPL[48]:1

See also https://discourse.julialang.org/t/country-codes/4010/7

Kind regards

loleg commented 4 years ago

@scls19fr bonne année! Thanks for raising. Did you find a workaround? It looks like a condition that should be handled in our code. I'll try to look into it.