diff --git a/Project.toml b/Project.toml index 2a16d38..8226d2f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,9 +1,13 @@ name = "Missings" uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" -version = "0.4.2" +version = "0.4.3" + +[deps] +DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" [compat] julia = "1" +DataAPI = "1.1" [extras] SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" diff --git a/appveyor.yml b/appveyor.yml index 8242986..4dd5286 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,8 @@ environment: matrix: - - julia_version: 0.7 - julia_version: 1.0 + - julia_version: 1.2 + - julia_version: 1.3 - julia_version: nightly platform: diff --git a/src/Missings.jl b/src/Missings.jl index e0d034d..b7c4c50 100644 --- a/src/Missings.jl +++ b/src/Missings.jl @@ -12,6 +12,8 @@ else using Base: nonmissingtype end +import DataAPI + @deprecate T nonmissingtype false # vector constructors @@ -150,27 +152,7 @@ end return (v::eltype(itr), s) end -""" - levels(x) - -Return a vector of unique values which occur or could occur in collection `x`, -omitting `missing` even if present. Values are returned in the preferred order -for the collection, with the result of [`sort`](@ref) as a default. - -Contrary to [`unique`](@ref), this function may return values which do not -actually occur in the data, and does not preserve their order of appearance in `x`. -""" -function levels(x) - T = nonmissingtype(eltype(x)) - levs = convert(AbstractArray{T}, filter!(!ismissing, unique(x))) - if hasmethod(isless, Tuple{T, T}) - try - sort!(levs) - catch - end - end - levs -end +const levels = DataAPI.levels struct PassMissing{F} <: Function f::F