Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix similar() to respect requested element type, implement float() an…
…d complex() (#133) similar(::CategoricalArray, T) used to return a CategoricalArray{T}, which is not a correct implementation of the AbstractArray interface. Change it to return Array{T}, except when T <: Union{CatValue,Missing}. This also fixes the behavior of AbstractArray constructors and convert methods, whose fallback definitions use similar(). With these fixes, implementing float() and complex() is trivial. Stop testing AbstractArray{T}(::CategoricalArray), which is not supported in Base either.
- Loading branch information
Showing
2 changed files
with
135 additions
and
14 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