Skip to content

Commit

Permalink
Merge pull request #40 from queryverse/vectorstring
Browse files Browse the repository at this point in the history
Force Vector{String} instead of StringVector
  • Loading branch information
davidanthoff authored Jan 15, 2019
2 parents bbda88e + 88bbfd8 commit 65ebaba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# CSVFiles.jl v0.13.0
* Never use StringVector, always use Vector{String} instead

# CSVFiles.jl v0.12.0
* Export FileIO.File and FileIO.@format_str

Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.7
TextParse 0.6.0
TextParse 0.7.0
IteratorInterfaceExtensions 0.1.1
TableTraits 0.4.0
TableTraitsUtils 0.2.1
Expand Down
8 changes: 4 additions & 4 deletions src/CSVFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function _loaddata(file)
if startswith(file.filename, "https://") || startswith(file.filename, "http://")
response = HTTP.get(file.filename)
data = String(response.body)
return TextParse._csvread(data, file.delim; file.keywords...)
return TextParse._csvread(data, file.delim; stringarraytype=Array, file.keywords...)
else
return csvread(file.filename, file.delim; file.keywords...)
return csvread(file.filename, file.delim; stringarraytype=Array, file.keywords...)
end
end

Expand All @@ -86,15 +86,15 @@ function TableTraits.get_columns_copy_using_missing(file::CSVFile)
end

function TableTraits.getiterator(s::CSVStream)
res = TextParse.csvread(s.io, s.delim; s.keywords...)
res = TextParse.csvread(s.io, s.delim; stringarraytype=Array, s.keywords...)

it = TableTraitsUtils.create_tableiterator([i for i in res[1]], [Symbol(i) for i in res[2]])

return it
end

function TableTraits.get_columns_copy_using_missing(s::CSVStream)
columns, colnames = TextParse.csvread(s.io, s.delim, s.keywords...)
columns, colnames = TextParse.csvread(s.io, s.delim; stringarraytype=Array, s.keywords...)
return NamedTuple{(Symbol.(colnames)...,), Tuple{typeof.(columns)...}}((columns...,))
end

Expand Down

0 comments on commit 65ebaba

Please sign in to comment.