JuliaML/MLDatasets.jl

Possible World Age issue when require error is not invoked

Dsantra92 opened this issue · 0 comments

Introduction

Loading a required package for a dataset can be done in two ways.

  1. Try to load a package $ \rightarrow $ figure out the additional packages from error $ \rightarrow $ import the packages and load it again.
  2. Load the required packages before trying to load a dataset.

While the 1st method gives no (final) error, the 2nd method gives possible world age issues.

Reproduce

Background: Loading OGB-Datasets requires the DataFrame package for processing the downloaded CSVs which contain the metadata for all available datasets. DataFrames is a require package.

  1. Importing DataFrames after I get a require import error (No Error)
using MLDatasets: OGBDataset
data = OGBDataset("ogbg-molhiv") # throws a error for import of DataFrames

using DataFrames # Import correction
data = OGBDataset("ogbg-molhiv") # Works fine
  1. Importing DataFrames with MLDatasets and then loading a dataset (Throws Error)
using MLDatasets, DataFrames
data = OGBDataset("ogbg-molhiv")

Error stacktrace:

ERROR: MethodError: no method matching iterate(::InlineStrings.String31)
The applicable method may be too new: running in world age 31389, while current world is 31398.
Closest candidates are:
  iterate(::InlineStrings.InlineString) at ~/.julia/packages/InlineStrings/F5Dhz/src/InlineStrings.jl:520 (method too new to be called from this world context.)
  iterate(::InlineStrings.InlineString, ::Int64) at ~/.julia/packages/InlineStrings/F5Dhz/src/InlineStrings.jl:520 (method too new to be called from this world context.)
  iterate(::AbstractString, ::Integer) at ~/julia/share/julia/base/strings/basic.jl:157
  ...
Stacktrace:
  [1] print(io::IOBuffer, s::InlineStrings.String31)
    @ Base ./strings/io.jl:191
  [2] print_to_string(xs::InlineStrings.String31)
    @ Base ./strings/io.jl:144
  [3] String(s::InlineStrings.String31)
    @ Base ./strings/string.jl:82
  [4] (::MLDatasets.var"#385#386")(r::DataFrameRow{DataFrame, DataFrames.Index})
    @ MLDatasets ./none:0
  [5] iterate
    @ ./generator.jl:47 [inlined]
  [6] Dict{String, Any}(kv::Base.Generator{DataFrames.DataFrameRows{DataFrame}, MLDatasets.var"#385#386"})
    @ Base ./dict.jl:103
  [7] read_ogb_metadata(fullname::String, dir::Nothing)
    @ MLDatasets ~/MLDatasets.jl/src/datasets/graphs/ogbdataset.jl:144
  [8] OGBDataset(fullname::String; dir::Nothing)
    @ MLDatasets ~/MLDatasets.jl/src/datasets/graphs/ogbdataset.jl:121
  [9] OGBDataset(fullname::String)
    @ MLDatasets ~/MLDatasets.jl/src/datasets/graphs/ogbdataset.jl:121
 [10] top-level scope
    @ REPL[2]:1

I am not exactly sure that this is the correct/intended behaviour.