You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing some strange behaviour from Query.jl (v. 0.3.0) when comparing Nullables to non-Nullables.
e.g.
# This first bit just illustrates that the issues derive from Query
julia>using DataFrames
julia>3<Nullable(4)
ERROR: MethodError: no method matching isless(::Int64, ::Nullable{Int64})
Closest candidates are:isless(::Nullable{Union{}}, ::Nullable{T}) at /Users/michael/.julia/v0.5/NullableArrays/src/operators.jl:161isless(::Real, ::AbstractFloat) at operators.jl:41isless(::Real, ::Real) at operators.jl:75...in<(::Int64, ::Nullable{Int64}) at ./operators.jl:63
julia>using Query
WARNING: Method definition require(Symbol) inmodule Base at loading.jl:345 overwritten inmodule Query at /Users/michael/.julia/v0.5/Requires/src/require.jl:12.
WARNING: Method definition ==(Base.Nullable{#T<:Any}, Base.Nullable{Union{}}) in module NullableArrays at /Users/michael/.julia/v0.5/NullableArrays/src/operators.jl:140 overwritten in module Query at /Users/michael/.julia/v0.5/Query/src/operators.jl:8.
WARNING: Method definition ==(Base.Nullable{Union{}}, Base.Nullable{#T<:Any}) in module NullableArrays at /Users/michael/.julia/v0.5/NullableArrays/src/operators.jl:139 overwritten in module Query at /Users/michael/.julia/v0.5/Query/src/operators.jl:9.
WARNING: Method definition ==(Base.Nullable{#T1<:Any}, Base.Nullable{#T2<:Any}) in module NullableArrays at /Users/michael/.julia/v0.5/NullableArrays/src/operators.jl:130 overwritten in module Query at /Users/michael/.julia/v0.5/Query/src/operators.jl:77.# This is the behaviour I find strange
julia>3<Nullable(4)
true
julia>3<Nullable()
false
The scalar boolean return value may be necessary for type stability, but I am thinking this may cause issues (I would expect the last expression to return Null).
The text was updated successfully, but these errors were encountered:
The next version of Query will no longer engage in this kind of type piracy, i.e. it will no longer overwrite comparison operators for Nullable. Instead, Query will use a custom type for missing data values within queries (probably called DataValue). For that type, 3 < DataValue() will still return false. For Query to work, predicates need to return Bool values, and that really seems the only way to do that right now.
I am seeing some strange behaviour from Query.jl (v. 0.3.0) when comparing Nullables to non-Nullables.
e.g.
The scalar boolean return value may be necessary for type stability, but I am thinking this may cause issues (I would expect the last expression to return Null).
The text was updated successfully, but these errors were encountered: