From d701c0962c608e56c261d2c9538262e04d58ddd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Mon, 28 Jun 2021 11:55:00 +0200 Subject: [PATCH] up DataAPI.jl to 1.7 and CategoricalArrays.jl to 0.10.0 (#2807) --- Project.toml | 4 ++-- src/DataFrames.jl | 7 +++++++ src/join/composer.jl | 4 +++- test/join.jl | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index ccb8bc9cdf..00fceee78c 100644 --- a/Project.toml +++ b/Project.toml @@ -23,9 +23,9 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [compat] -CategoricalArrays = "0.9.3" +CategoricalArrays = "0.10.0" Compat = "3.17" -DataAPI = "1.6" +DataAPI = "1.7" InvertedIndices = "1" IteratorInterfaceExtensions = "0.1.1, 1" Missings = "0.4.2, 1" diff --git a/src/DataFrames.jl b/src/DataFrames.jl index b7a071a3f4..ca52ed392e 100644 --- a/src/DataFrames.jl +++ b/src/DataFrames.jl @@ -14,6 +14,13 @@ import DataAPI, DataAPI.Between, DataAPI.Cols, DataAPI.describe, + DataAPI.innerjoin, + DataAPI.outerjoin, + DataAPI.rightjoin, + DataAPI.leftjoin, + DataAPI.semijoin, + DataAPI.antijoin, + DataAPI.crossjoin, Tables, Tables.columnindex, Future.copy! diff --git a/src/join/composer.jl b/src/join/composer.jl index 8c64a82959..e49078e8b9 100644 --- a/src/join/composer.jl +++ b/src/join/composer.jl @@ -1,6 +1,8 @@ ## ## Join / merge ## +## Implements methods for join functions defined in DataAPI.jl +## # Like similar, but returns a array that can have missings and is initialized with missings similar_missing(dv::AbstractArray{T}, dims::Union{Int, Tuple{Vararg{Int}}}) where {T} = @@ -46,7 +48,7 @@ struct DataFrameJoiner "Symbol or Pair{Symbol, Symbol}.")) end end - + if matchmissing === :notequal if kind in (:left, :semi, :anti) dfr = dropmissing(dfr, right_on, view=true) diff --git a/test/join.jl b/test/join.jl index d16050436f..656a863cf6 100644 --- a/test/join.jl +++ b/test/join.jl @@ -356,7 +356,7 @@ end @test levels(leftjoin(B, A, on=:b).b) == ["a", "b", "c"] @test levels(rightjoin(A, B, on=:b).b) == ["a", "b", "c"] @test levels(rightjoin(B, A, on=:b).b) == ["d", "c", "b", "a"] - @test levels(outerjoin(B, A, on=:b).b) == ["a", "b", "d", "c"] + @test levels(outerjoin(B, A, on=:b).b) == ["d", "a", "b", "c"] @test levels(outerjoin(A, B, on=:b).b) == ["d", "c", "b", "a"] @test levels(semijoin(A, B, on=:b).b) == ["d", "c", "b", "a"] @test levels(semijoin(B, A, on=:b).b) == ["a", "b", "c"]