Skip to content

Commit

Permalink
Silence deprecation warnings from string and escape_string (#204)
Browse files Browse the repository at this point in the history
These functions print warnings because CategoricalString is still an AbstractString,
but the methods themselves are not deprecated, and the warnings will go away once
inheritance is removed. This is particularly visible when working with DataFrames.
  • Loading branch information
nalimilan committed Sep 5, 2019
1 parent 1e60381 commit fb50af2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,9 @@ import Unicode: normalize, graphemes
@deprecate chomp(x::CategoricalString) chomp(String(x))
@deprecate textwidth(x::CategoricalString) textwidth(String(x))
@deprecate isascii(x::CategoricalString) isascii(String(x))
@deprecate escape_string(x::CategoricalString) escape_string(String(x))
@deprecate escape_string(x::CategoricalString) escape_string(String(x))

# Avoid printing a deprecation until CategoricalString is no longer AbstractString
Base.write(io::IO, x::CategoricalString) = write(io, get(x))
Base.escape_string(io::IO, x::CategoricalString, esc) = escape_string(io, get(x), esc)
Base.tostr_sizehint(x::CategoricalString) = Base.tostr_sizehint(get(x))

0 comments on commit fb50af2

Please sign in to comment.