-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restrict wrapped types to reduce invalidations (#310)
Methods like `convert(::Type{Any}, ::CategoricalValue)` triggers lots of invalidations. Restricting the wrapped types to `AbstractString`, `AbstractChar` and `Number` alleviates this problem without affecting usability too much. One limit with this approach is that e.g. `convert(Union{String, T}, CategoricalValue{String})` won't work anymore for any `T`, even though `convert(String, CategoricalValue{String})` will. Though thanks to special casing, it will work for `T <: Missing` and `T <: Nothing`. This also means that `CategoricalArray{Any}` is no longer supported. Adapt promotion rules to ensure that mixing e.g. strings and integers gives `Union{String, Integer}`. Drop support for `nothing`. Also remove the custom `repr` method which was a legacy of the `CategoricalString` era.
- Loading branch information
Showing
11 changed files
with
213 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.