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

Incorrect line number for kwarg function call in stack trace #45171

Closed
BioTurboNick opened this issue May 3, 2022 · 0 comments · Fixed by #45199
Closed

Incorrect line number for kwarg function call in stack trace #45171

BioTurboNick opened this issue May 3, 2022 · 0 comments · Fixed by #45199
Assignees

Comments

@BioTurboNick
Copy link
Contributor

using DataFrames

a = [1, 2, 3]
b = [3, 4]
c() = DataFrame(:a => a, :b => b)
c()

#=
ERROR: DimensionMismatch: column :a has length 3 and column :b has length 2
Stacktrace:
 [1] DataFrame(columns::Vector{Any}, colindex::DataFrames.Index; copycols::Bool)
   @ DataFrames C:\Users\nicho\.julia\packages\DataFrames\zqFGs\src\dataframe\dataframe.jl:192
 [2] DataFrame(::Pair{Symbol, Vector{Int64}}, ::Vararg{Pair{Symbol, Vector{Int64}}}; makeunique::Bool, copycols::Bool)
   @ DataFrames C:\Users\nicho\.julia\packages\DataFrames\zqFGs\src\dataframe\dataframe.jl:247
 [3] DataFrame(::Pair{Symbol, Vector{Int64}}, ::Vararg{Pair{Symbol, Vector{Int64}}})
   @ DataFrames C:\Users\nicho\.julia\packages\DataFrames\zqFGs\src\dataframe\dataframe.jl:245
 [4] c()
   @ Main .\REPL[4]:1
 [5] top-level scope
   @ REPL[5]:1
=#

image

image

The screenshot is from C:\Users\nicho.julia\packages\DataFrames\zqFGs\src\dataframe\dataframe.jl

Line 192 is where the error is thrown. Line 247 is the call site of the function that threw the error. Is Line 245 is supposed to be Line 243?

Another example, where the line number is only 1 off:

function aa()
       1
       2
       3
       error(3)
end

 function bb()
       3
       4
       aa()
end

function cc(;kwarg = true)
       1
       bb()
end

cc()

#=
ERROR: 3
Stacktrace:
 [1] error(s::Int64)
   @ Base .\error.jl:42
 [2] aa()
   @ Main .\REPL[1]:5
 [3] bb()
   @ Main .\REPL[2]:4
 [4] cc(; kwarg::Bool)
   @ Main .\REPL[3]:3
 [5] cc()
   @ Main .\REPL[3]:2
 [6] top-level scope
   @ REPL[4]:1
=#
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

Successfully merging a pull request may close this issue.

2 participants