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

[BREAKING] remove CategoricalArrays dependency from joins #2505

Merged
merged 5 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
choose the fast path only when it is safe; this resolves inconsistencies
with what the same functions not using fast path produce
([#2357](https://github.com/JuliaData/DataFrames.jl/pull/2357))
* joins now return `PooledVector` not `CategoricalVector` in indicator column
([#2505](https://github.com/JuliaData/DataFrames.jl/pull/2505))
* `GroupKeys` now supports `in` for `GroupKey`, `Tuple`, `NamedTuple` and dictionaries
([2392](https://github.com/JuliaData/DataFrames.jl/pull/2392))
* in `describe` the specification of custom aggregation is now `function => name`;
Expand Down
8 changes: 5 additions & 3 deletions src/abstractdataframe/join.jl
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,11 @@ function _join(df1::AbstractDataFrame, df2::AbstractDataFrame;
end

if indicator !== nothing
refs = left_indicator + right_indicator
pool = CategoricalPool{String,UInt8}(["left_only", "right_only", "both"])
indicatorcol = CategoricalArray{String,1}(refs, pool)
left_indicator .+= right_indicator
pa_base = PooledArray(["left_only", "right_only", "both"])
bkamins marked this conversation as resolved.
Show resolved Hide resolved
indicatorcol = PooledArray(PooledArrays.RefArray(left_indicator),
Dict{String, UInt8}("left_only" => 0x1, "right_only" => 0x2, "both" => 0x3),
bkamins marked this conversation as resolved.
Show resolved Hide resolved
["left_only", "right_only", "both"])

unique_indicator = indicator
if makeunique
Expand Down