Skip to content

Commit

Permalink
Update to julia 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Aug 3, 2018
1 parent 378a5e3 commit d7b4815
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
@@ -1,4 +1,4 @@
julia 0.6
julia 0.7-
TextParse
JSON
DataValues
Expand Down
9 changes: 4 additions & 5 deletions src/VegaDatasets.jl
@@ -1,4 +1,3 @@
__precompile__()
module VegaDatasets

using JSON, TextParse, DataValues, TableShowUtils, DataStructures,
Expand All @@ -8,7 +7,7 @@ import IterableTables
export dataset

struct VegaDataset
data::Union{OrderedDict{Symbol,Any}, Void}
data::Union{OrderedDict{Symbol,Any}, Nothing}
path::AbstractPath
end

Expand Down Expand Up @@ -52,22 +51,22 @@ function load_json(filename)
coltypes = Type[]
for col in colnames
curr_T = typeof(get(json_data[1], col, DataValues.NA))
if curr_T <: Void
if curr_T <: Nothing
curr_T = typeof(DataValues.NA)
end
col_type = curr_T

for row in 2:length(json_data)
curr_T = typeof(get(json_data[row], col, DataValues.NA))
if curr_T <: Void
if curr_T <: Nothing
curr_T = typeof(DataValues.NA)
end
col_type = Base.promote_type(col_type, curr_T)
end
push!(coltypes, col_type)
end

coldata = [ct <: DataValue ? DataValueVector{eltype(ct)}(nrows) : Vector{ct}(nrows) for ct in coltypes]
coldata = [ct <: DataValue ? DataValueVector{eltype(ct)}(nrows) : Vector{ct}(undef, nrows) for ct in coltypes]

for (i,row) in enumerate(json_data)
for colindx in 1:ncols
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
@@ -1,6 +1,6 @@
using VegaDatasets
import IteratorInterfaceExtensions, TableTraits, TableShowUtils
using Base.Test
using Test

@testset "VegaDatasets" begin

Expand Down

0 comments on commit d7b4815

Please sign in to comment.