Viewing dataframe with vscodedisplay produces ERROR

Hello,

I have a problem viewing into a dataframe. I have the latest VS Code version (1.50.1 and Julia plugin 1.08). What should I do?

vscodedisplay(df)
ERROR: MethodError: julia_type_to_schema_type(::Type{Union{}}) is ambiguous. Candidates:
julia_type_to_schema_type(::Type{T}) where T<:AbstractFloat in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:47
julia_type_to_schema_type(::Type{T}) where T<:Integer in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:48
julia_type_to_schema_type(::Type{T}) where T<:Dates.Time in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:50
julia_type_to_schema_type(::Type{T}) where T<:Bool in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:49
julia_type_to_schema_type(::Type{T}) where T<:Dates.Date in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:51
julia_type_to_schema_type(::Type{T}) where T<:Dates.DateTime in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:52
julia_type_to_schema_type(::Type{T}) where T<:AbstractString in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:53
julia_type_to_schema_type(::Type{T}) where {S, T<:DataValues.DataValue{S}} in VSCodeServer at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\display.jl:177
Possible fix, define
julia_type_to_schema_type(::Type{Union{}})
Stacktrace:
[1] julia_type_to_schema_type(::Type{DataValues.DataValue{Union{}}}) at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\display.jl:177
[2] printdataresource(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Tables.DataValueRowIterator{NamedTuple{(:etl_source, :etl_source_val, :etl_target, :etl_target_val, :tabstruct, :tabstruct_val, :rowfilter,
:rfilter_col, :rfilter_val, :rfilter_op, :param, :param_value, :scenario, :sc_alias, :filterPosCols, :filterNegCols, :recode_col, :recode_before, :recode_after, :na_cols, :na_fill, :onehot, :filterNegLevels, :turfFilterNegBiLink1, :turfFilterNegBiLink2),Tuple{DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{Float64},DataValues.DataValue{String},DataValues.DataValue{String},DataValues.DataValue{Float64},String,String,DataValues.DataValue{String},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}},DataValues.DataValue{Union{}}}},Tables.Schema{(:etl_source, :etl_source_val, :etl_target, :etl_target_val, :tabstruct, :tabstruct_val, :rowfilter, :rfilter_col, :rfilter_val, :rfilter_op, :param, :param_value, :scenario, :sc_alias, :filterPosCols, :filterNegCols, :recode_col, :recode_before, :recode_after, :na_cols, :na_fill, :onehot, :filterNegLevels, :turfFilterNegBiLink1, :turfFilterNegBiLink2),Tuple{Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, String},Union{Missing, Float64},Union{Missing, String},Union{Missing, String},Union{Missing, Float64},String,String,Union{Missing, String},Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing,Missing}},Tables.RowIterator{NamedTuple{(:etl_source, :etl_source_val, :etl_target, :etl_target_val, :tabstruct, :tabstruct_val, :rowfilter, :rfilter_col, :rfilter_val, :rfilter_op, :param, :param_value, :scenario, :sc_alias, :filterPosCols, :filterNegCols, :recode_col, :recode_before, :recode_after, :na_cols, :na_fill, :onehot, :filterNegLevels, :turfFilterNegBiLink1, :turfFilterNegBiLink2),Tuple{Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, Float64},1},Array{Union{Missing, String},1},Array{Union{Missing, String},1},Array{Union{Missing, Float64},1},Array{String,1},Array{String,1},Array{Union{Missing, String},1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1},Array{Missing,1}}}}}) at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\gridviewer.jl:83
[3] internal_vscodedisplay(::DataFrame) at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\display.jl:199
[4] vscodedisplay(::DataFrame) at c:\Users\49152.vscode\extensions\julialang.language-julia-1.0.8\scripts\packages\VSCodeServer\src\display.jl:223
[5] top-level scope at REPL[12]:1

1 Like

Hi,

Are you able to display a minimal DataFrame?

In vscode, create a tmp.jl file and try running Julia: Execute File Ctrl+R, Ctrl+F on this minimal DataFrame:

import Pkg; Pkg.add("DataFrames")
using DataFrames
vscodedisplay(DataFrame(a=collect(1:10)))

Hopefully you will see the Julia table rendered.

If you are able to see that minimal DataFrame displayed the error may be that your data is too complex to display without some transforms.

If not, try updating to the most recent vscode and julia-vscode plugin?