Skip to content

Commit

Permalink
[BREAKING] Stop reexporting CategoricalArrays (#2404)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan authored Sep 1, 2020
1 parent 6859942 commit fe2da01
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 24 deletions.
17 changes: 10 additions & 7 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## Breaking changes

* CategoricalArrays.jl is no longer reexported: call `using CategoricalArrays`
to use it [#2404]((https://github.com/JuliaData/DataFrames.jl/pull/2404)).
In the same vein, the `categorical` and `categorical!` functions
have been deprecated in favor of
`transform(df, cols .=> categorical .=> cols)` and similar syntaxes
[#2394]((https://github.com/JuliaData/DataFrames.jl/pull/2394)).
`stack` now creates a `PooledVector{String}` variable column rather than
a `CategoricalVector{String}` column by default;
pass `variable_eltype=CategoricalValue{String}` to get the previous behavior
([#2391](https://github.com/JuliaData/DataFrames.jl/pull/2391))
* `isless` for `DataFrameRow`s now checks column names
([#2292](https://github.com/JuliaData/DataFrames.jl/pull/2292))
* `DataFrameColumns` is now not a subtype of `AbstractVector`
Expand All @@ -22,13 +32,6 @@
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))
* `stack` now creates a `PooledVector{String}` variable column rather than
a `CategoricalVector{String}` column by default;
pass `variable_eltype=CategoricalValue{String}` to get the previous behavior
([#2391](https://github.com/JuliaData/DataFrames.jl/pull/2391))
* the `categorical` and `categorical!` functions have been deprecated in favor of
`transform(df, cols .=> categorical .=> cols)` and similar syntaxes
[#2394]((https://github.com/JuliaData/DataFrames.jl/pull/2394))

## New functionalities

Expand Down
4 changes: 2 additions & 2 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module DataFrames

using Statistics, Printf, REPL
using Reexport, SortingAlgorithms, Compat, Unicode, PooledArrays
@reexport using CategoricalArrays, Missings, InvertedIndices
using Reexport, SortingAlgorithms, Compat, Unicode, PooledArrays, CategoricalArrays
@reexport using Missings, InvertedIndices
using Base.Sort, Base.Order, Base.Iterators
using TableTraits, IteratorInterfaceExtensions
import LinearAlgebra: norm
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/reshape.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ that return views into the original data frame.
By default a `PooledArray{String}` is created.
If `variable_eltype=Symbol` a `PooledVector{Symbol}` is created,
and if `variable_eltype=CategoricalValue{String}`
a `CategoricalArray{String}` is produced.
a `CategoricalArray{String}` is produced (call `using CategoricalArrays` first if needed)
Passing any other type `T` will produce a `PooledVector{T}` column
as long as it supports conversion from `String`.
When `view=true`, a `RepeatedVector{T}` is produced.
Expand Down
2 changes: 1 addition & 1 deletion test/broadcasting.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestBroadcasting

using Test, DataFrames, PooledArrays, Random
using Test, DataFrames, PooledArrays, Random, CategoricalArrays

const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/cat.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestCat

using Test, Random, DataFrames
using Test, Random, DataFrames, CategoricalArrays
const = isequal

#
Expand Down
2 changes: 1 addition & 1 deletion test/constructors.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestConstructors

using Test, DataFrames
using Test, DataFrames, CategoricalArrays
using DataFrames: Index, _columns, index
const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/data.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestData

using Test, DataFrames, Random, Statistics
using Test, DataFrames, Random, Statistics, CategoricalArrays
const = isequal

@testset "constructors" begin
Expand Down
3 changes: 2 additions & 1 deletion test/dataframe.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module TestDataFrame

using Dates, DataFrames, Statistics, Random, Test, Logging, DataStructures
using Dates, DataFrames, Statistics, Random, Test, Logging, DataStructures,
CategoricalArrays
using DataFrames: _columns, index
const = isequal
const = !isequal
Expand Down
2 changes: 1 addition & 1 deletion test/dataframerow.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestDataFrameRow

using Test, DataFrames, Random, Logging
using Test, DataFrames, Random, Logging, CategoricalArrays
const = isequal
const = !isequal

Expand Down
2 changes: 1 addition & 1 deletion test/deprecated.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestDeprecated

using Test, DataFrames
using Test, DataFrames, CategoricalArrays

const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/duplicates.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestDuplicates

using Test, DataFrames
using Test, DataFrames, CategoricalArrays
const = isequal

@testset "nonunique" begin
Expand Down
2 changes: 1 addition & 1 deletion test/grouping.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestGrouping

using Test, DataFrames, Random, Statistics, PooledArrays
using Test, DataFrames, Random, Statistics, PooledArrays, CategoricalArrays
const = isequal

"""Check if passed data frames are `isequal` and have the same element types of columns"""
Expand Down
2 changes: 1 addition & 1 deletion test/join.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestJoin

using Test, DataFrames, Random
using Test, DataFrames, Random, CategoricalArrays
using DataFrames: similar_missing
const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/reshape.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestReshape

using Test, DataFrames, Random, Logging, PooledArrays
using Test, DataFrames, Random, Logging, PooledArrays, CategoricalArrays
const = isequal

@testset "the output of unstack" begin
Expand Down
2 changes: 1 addition & 1 deletion test/select.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestSelect

using DataFrames, Test, Random, Statistics
using DataFrames, Test, Random, Statistics, CategoricalArrays

const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/sort.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestSort

using DataFrames, Random, Test
using DataFrames, Random, Test, CategoricalArrays

@testset "standard tests" begin
dv1 = [9, 1, 8, missing, 3, 3, 7, missing]
Expand Down
2 changes: 1 addition & 1 deletion test/tables.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestTables

using Test, DataFrames
using Test, DataFrames, CategoricalArrays

struct NamedTupleIterator{T <: NamedTuple}
elements::Vector{T}
Expand Down

0 comments on commit fe2da01

Please sign in to comment.