Skip to content

Commit

Permalink
make sure we correctly pass matchmissing in joins (#3040)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Apr 15, 2022
1 parent c9a41b0 commit 093d9fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DataFrames"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.3.2"
version = "1.3.3"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
6 changes: 4 additions & 2 deletions src/join/composer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ innerjoin(df1::AbstractDataFrame, df2::AbstractDataFrame, dfs::AbstractDataFrame
makeunique::Bool=false,
validate::Union{Pair{Bool, Bool}, Tuple{Bool, Bool}}=(false, false),
matchmissing::Symbol=:error) =
innerjoin(innerjoin(df1, df2, on=on, makeunique=makeunique, validate=validate),
innerjoin(innerjoin(df1, df2, on=on, makeunique=makeunique, validate=validate,
matchmissing=matchmissing),
dfs..., on=on, makeunique=makeunique, validate=validate,
matchmissing=matchmissing)

Expand Down Expand Up @@ -1042,7 +1043,8 @@ outerjoin(df1::AbstractDataFrame, df2::AbstractDataFrame, dfs::AbstractDataFrame
on::Union{<:OnType, AbstractVector} = Symbol[], makeunique::Bool=false,
validate::Union{Pair{Bool, Bool}, Tuple{Bool, Bool}}=(false, false),
matchmissing::Symbol=:error) =
outerjoin(outerjoin(df1, df2, on=on, makeunique=makeunique, validate=validate),
outerjoin(outerjoin(df1, df2, on=on, makeunique=makeunique, validate=validate,
matchmissing=matchmissing),
dfs..., on=on, makeunique=makeunique, validate=validate,
matchmissing=matchmissing)

Expand Down
15 changes: 15 additions & 0 deletions test/join.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2184,4 +2184,19 @@ end
@test df1.y isa Vector{Union{Int, Missing}}
end

@testset "passing matchmissing in multi-data frame innerjoin and outerjoin" begin
@test innerjoin(DataFrame(a=missing, b=1),
DataFrame(a=missing, c=2),
DataFrame(a=missing, d=3),
on=:a, matchmissing=:equal) DataFrame(a=missing, b=1, c=2, d=3)
@test isempty(innerjoin(DataFrame(a=missing, b=1),
DataFrame(a=missing, c=2),
DataFrame(a=missing, d=3),
on=:a, matchmissing=:notequal))
@test outerjoin(DataFrame(a=missing, b=1),
DataFrame(a=missing, c=2),
DataFrame(a=missing, d=3),
on=:a, matchmissing=:equal) DataFrame(a=missing, b=1, c=2, d=3)
end

end # module

2 comments on commit 093d9fc

@bkamins
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register branch=patch_v1.3

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/58561

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.3 -m "<description of version>" 093d9fc06b1a673dd65d7e37adc22ce1913731c7
git push origin v1.3.3

Please sign in to comment.