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: MethodError: Cannot convert an object of type Nothing to an object of type String #21

Open
s-celles opened this issue Dec 6, 2019 · 1 comment
Labels

Comments

@s-celles
Copy link
Contributor

s-celles commented Dec 6, 2019

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

@roll roll added the bug label Dec 10, 2019
@loleg
Copy link
Collaborator

loleg commented Jan 4, 2020

@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.

@roll roll added bug and removed bug labels Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants