VS-Code Lint error in DataFrame column access

The following code show a lint error in VS-Code:

using DataFrames
function Mainline()
    df = DataFrame(col_name = 1:3)

    # this line runs but a linter error is displayed for col_name
    var1 = minimum(df.col_name)

    # these lines all run with no linter errors
    var2 = minimum(df."col_name")
    var3 = minimum(df[!,"col_name"])
    var4 = minimum(df[!,:col_name])

    @show(var1, var2, var3, var4)
end
Mainline()

Why is the lint error being shown for the var1 line?
The DataFrames doc says that “var1 = minimum(df.col_name)” is an allowed access.

This is not a big deal because the code still runs.

It is allowed, and I would say that this is the most common way to do it.

The linter isn’t very good at the minute, and has anecdotally become worse with 1.10. See:

1 Like

Thanks for the update.
Irrespective of the lint error, VS-Code still rocks!

1 Like

You can look at the linter settings in the Julia extension settings to turn off those linter passes which add more noise than useful info.