diff --git a/src/downloads.jl b/src/downloads.jl index 5fd4ec8..4e2c56f 100644 --- a/src/downloads.jl +++ b/src/downloads.jl @@ -130,7 +130,7 @@ function fred(data::AbstractString="CPIAUCNS") url = "http://research.stlouisfed.org/fred2/series/$data/downloaddata/$data.csv" res = HTTP.get(url) @assert res.status == 200 - csv = CSV.File(res.body) + csv = CSV.File(res.body, missingstring = ".") sch = TimeSeries.Tables.schema(csv) TimeArray(csv, timestamp = first(sch.names)) |> cleanup_colname! end @@ -175,7 +175,7 @@ function ons(timeseries::AbstractString = "L522", dataset::AbstractString = "MM2 data = json["months"] dates = [Date(x["year"]*" "*x["month"], dateformat"Y U") for x in data] values = [parse(Float64, x["value"]) for x in data] - ta = TimeArray((timestamp = dates, monthly = values),timestamp=:timestamp) + ta = TimeArray((timestamp = dates, monthly = values), timestamp = :timestamp) end if "quarters" in keys(json) data = json["quarters"] diff --git a/test/downloads.jl b/test/downloads.jl index 8ec367e..4b68b22 100644 --- a/test/downloads.jl +++ b/test/downloads.jl @@ -7,6 +7,7 @@ using Test @test ta |> timestamp |> length > 100 ta = fred("DGS10") @test ta |> timestamp |> length > 100 + @test !(ta isa TimeArray{T} where T<:AbstractString) end @testset "Yahoo" begin