Skip to content

Commit

Permalink
Relax type assert because of JuliaLang/julia#26135
Browse files Browse the repository at this point in the history
  • Loading branch information
iamed2 committed Feb 21, 2018
1 parent 22558cf commit 4197746
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/datastreams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Data.accesspattern(jl_result::Result) = RandomAccess()
# end
# end

@inline _non_null_type(::Type{Union{T, Missing}}) where {T} = T
@inline _non_null_type(::Type{T}) where {T} = T
# @inline _non_null_type(::Type{Union{T, Missing}}) where {T} = T
# @inline _non_null_type(::Type{T}) where {T} = T

# allow types that aren't just unions to handle nulls
function Data.streamfrom(
Expand All @@ -53,13 +53,11 @@ function Data.streamfrom(
row::Int,
col::Int,
)::T where T>:Missing
NNT = _non_null_type(T)

if libpq_c.PQgetisnull(jl_result.result, row - 1, col - 1) == 1
return missing
else
oid = jl_result.column_oids[col]
return jl_result.column_funcs[col](PQValue{oid}(jl_result, row, col))::NNT
return jl_result.column_funcs[col](PQValue{oid}(jl_result, row, col)) # ::_non_null_type(T) except https://github.com/JuliaData/Missings.jl/issues/80
end
end

Expand Down

0 comments on commit 4197746

Please sign in to comment.