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

include_string causes spurious AbstractRange deprecation warnings #24447

Closed
quinnj opened this issue Nov 2, 2017 · 3 comments
Closed

include_string causes spurious AbstractRange deprecation warnings #24447

quinnj opened this issue Nov 2, 2017 · 3 comments

Comments

@quinnj
Copy link
Member

quinnj commented Nov 2, 2017

On current DataFrames master there is an include_string call, which results in

WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8
WARNING: Base.Range is deprecated, use Base.AbstractRange{T} where T instead.
  likely near /Users/jacobquinn/.julia/v0.7/DataFrames/src/subdataframe/subdataframe.jl:8

Removing the call to include_string removes the deprecation warnings.

@stevengj
Copy link
Member

stevengj commented Nov 2, 2017

It looks like the problem may be related to the fact that you were using a deprecated version of include_string that takes only a single string argument (#22064):

julia> include_string("1+1")
WARNING: include_string(string) is deprecated, use `include_string(module, string)` instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:68
 [2] include_string(::String) at ./deprecated.jl:1262
 [3] eval(::Module, ::Expr) at ./repl/REPL.jl:3
 [4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./repl/REPL.jl:69
 [5] macro expansion at ./repl/REPL.jl:100 [inlined]
 [6] (::getfield(Base.REPL, Symbol("##1#2")){Base.REPL.REPLBackend})() at ./event.jl:95
in expression starting at no file:0
2

If you pass a module, do you still see a deprecation?

julia> include_string(Main, "1+1")
2

I'm not sure why you'd be seeing the Base.Range deprecation, though. cc @vtjnash

@JeffBezanson
Copy link
Member

What's happening here is pretty weird, though it does ultimately relate to uses of Range in DataFrames that are easily found with grep.

The DataFrame constructor uses Range. After it's loaded, any time something in the system uses a Dict or Set in a way that requires inferring hash(::Any, ), the DataFrame hash method is examined which somehow leads to inferring the DataFrame constructor, which triggers the warning when inference looks up the value of Range. Here's an inference stack trace, from hitting an arrow in the repl (which also spews these warnings with DataFrames loaded, for the same reason):

(::Type{DataFrames.DataFrame})(Array{Any, 1}, DataFrames.Index)  [limited]
 ht_keyindex2(Base.Dict{K, V} where V where K, Any)  [limited]
 setindex!(Base.Dict{K, V}, Any, K) where {K, V}  [limited]
 push!(Base.Dict{_, _} where _ where _, Base.Pair{A, B} where B where A)  [limited]
 copy!(Base.Dict{_, _} where _ where _, Base.Associative{K, V} where V where K)  [limited]
 grow_to!(Base.Associative{K, V}, Base.Generator{_, getfield(DataFrames, Symbol("##33#35"))} where _, Any) where {K, V}  [limited]
 collect_to_with_first!(Any, String, Base.Generator{_, getfield(DataFrames, Symbol("##33#35"))} where _, Any)  [limited]
 collect(Base.Generator{_, getfield(DataFrames, Symbol("##33#35"))} where _)  [limited]
 (::Type{DataFrames.DataFrame})(Array{Any, 1}, DataFrames.Index)  [limited]
 copy(DataFrames.DataFrame)  [limited]
 getindex(DataFrames.DataFrame, Base.Colon)  [limited]
 hash(DataFrames.AbstractDataFrame)  [limited]
 hashindex(Any, Int64)  [limited]
 setindex!(Base.Dict{K, V}, Char, K) where {K, V}  [limited]
 setindex!(Base.Dict{_, _} where _ where _, Char, Char)  [limited]
 setindex!(Base.Dict{_, _} where _ where _, Char, Any)  [limited]
 grow_to!(Base.Dict{K, V} where V where K, Base.Generator{_, getfield(DataFrames, Symbol("##33#35"))} where _, Any)  [limited]
 copy!(Base.Dict{K, V} where V where K, Base.Dict{K, V} where V where K)  [limited]
setindex!(Base.Dict{K, V}, Base.LineEdit.PrefixSearchState, K) where {K, V}
setindex!(Base.Dict{K, V} where V where K, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider})
transition(getfield(Base.LineEdit, Symbol("##34#35")){Base.LineEdit.MIState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}, _, _} where _ where _, Base.LineEdit.MIState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider})
enter_prefix_search(Base.LineEdit.MIState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}, Bool)
(::getfield(Base.LineEdit, Symbol("##222#226")){Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}})(Base.LineEdit.MIState, Base.REPL.LineEditREPL, Any...)

@KristofferC
Copy link
Member

Think this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants