Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up DataAPI.jl to 1.7 and CategoricalArrays.jl to 0.10.0 #2807

Merged
merged 2 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
nalimilan marked this conversation as resolved.
Show resolved Hide resolved
Compat = "3.17"
DataAPI = "1.6"
DataAPI = "1.7"
InvertedIndices = "1"
IteratorInterfaceExtensions = "0.1.1, 1"
Missings = "0.4.2, 1"
Expand Down
7 changes: 7 additions & 0 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
4 changes: 3 additions & 1 deletion src/join/composer.jl
Original file line number Diff line number Diff line change
@@ -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} =
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/join.jl
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ end
@test levels(leftjoin(A, B, on=:b).b) == ["d", "c", "b", "a"]
@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"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nalimilan - these changes follow CategoricalArrays.jl 0.10.0 release, so a check would be welcome.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Why aren't levels the same for inner and outer joins? ["d", "c", "b", "a"] would sound like a good choice since levels(A.b) is a superset of levels(B.b).

That said, since the old behavior wasn't ideal either, the new one is OK -- both are kind of arbitrary.

@test levels(outerjoin(B, A, on=:b).b) == ["a", "b", "d", "c"]
@test levels(rightjoin(B, A, on=:b).b) == ["d", "c", "b", "a"]
bkamins marked this conversation as resolved.
Show resolved Hide resolved
@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"]
Expand Down