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

subset not defined #324

Open
wizofe opened this issue Feb 8, 2022 · 12 comments
Open

subset not defined #324

wizofe opened this issue Feb 8, 2022 · 12 comments

Comments

@wizofe
Copy link

wizofe commented Feb 8, 2022

On a clean environment with DataFramesMeta and Julia 1.7.2 I am getting this error:

UndefVarError: subset not defined

Any idea why?

@pdeffebach
Copy link
Collaborator

Interesting. Thank you for reporting! I will debug.

@wizofe
Copy link
Author

wizofe commented Feb 8, 2022

Specifically, this is the error I am getting:

UndefVarError: subset not defined

    subset_helper(::Symbol, ::Expr)@macros.jl:427
    var"@subset"(::LineNumberNode, ::Module, ::Any, ::Vararg{Any})@macros.jl:577
    #macroexpand#[email protected]:115[inlined]
    [email protected]:114[inlined]
    try_macroexpand(::Module, ::Base.UUID, ::Expr)@PlutoRunner.jl:253
    var"#run_expression#25"(::Bool, ::typeof(Main.PlutoRunner.run_expression), ::Module, ::Expr, ::Base.UUID, ::Nothing, ::Nothing)@PlutoRunner.jl:482
    top-level scope@none:1

@pdeffebach
Copy link
Collaborator

I cannot replicate. Can you list the output of import Pkg; Pkg.status()?

@wizofe
Copy link
Author

wizofe commented Feb 8, 2022

julia> Pkg.status()
      Status `~/Projects/EDA/Project.toml`
  [336ed68f] CSV v0.10.2
  [159f3aea] Cairo v1.0.5
  [35d6a980] ColorSchemes v3.17.0
  [a93c6f00] DataFrames v1.3.2
  [1313f7d8] DataFramesMeta v0.10.0
  [31c24e10] Distributions v0.25.46
  [c91e804a] Gadfly v1.3.4
  [c27321d9] Glob v1.3.0
  [09f84164] HypothesisTests v0.10.6
  [a3a9e032] NIfTI v0.5.6
  [c3e4b0f8] Pluto v0.18.0
  [2913bbd2] StatsBase v0.33.14
  [10745b16] Statistics

But I am using Pluto, so those may not be the exact versions Pluto is using.

@pdeffebach
Copy link
Collaborator

Uh oh.

Please confirm if it works on a normal REPL. I will install Pluto and see if I can replicate.

@wizofe
Copy link
Author

wizofe commented Feb 8, 2022

Ok here's what Pluto is using:

  [e1450e63] BufferedStreams v1.0.0
  [336ed68f] CSV v0.8.5
  [a93c6f00] DataFrames v0.22.7
  [1313f7d8] DataFramesMeta v0.8.0
  [c91e804a] Gadfly v1.3.4
  [c27321d9] Glob v1.3.0
  [09f84164] HypothesisTests v0.10.6
  [a3a9e032] NIfTI v0.5.6
  [7f904dfe] PlutoUI v0.7.1
  [44cfe95a] Pkg
  [10745b16] Statistics

@pdeffebach
Copy link
Collaborator

That's an incredibly old version of DataFrames.jl.

I'm still confused about subset. I would have hoped a DataFramesMeta.jl vrsion which supports @subset wouldn't be compatible with a DataFrames.jl version which does not support subset.

Nonetheless, this is definitely a Pluto.jl problem. They should not be downgrading to packages that are over a year old. Can you see why Pluto is downgrading?

@wizofe
Copy link
Author

wizofe commented Feb 8, 2022

Yes, I've just noticed as I pasted this. WOW. I am not sure how to check why the package is being downgraded. Any tips on that?

In any case thanks for your time, I will definitely post this over there.

Meanwhile I found that by doing Pkg.activate() in the start of the notebook I can use my package's environment and ignore Pluto package management.

@pdeffebach
Copy link
Collaborator

Okay I can confirm I did not do my due-diligence in compatability bounds when releasing DataFramesMeta.jl version 0.8.0. So that part of the error is on me. But given we have moved on to post DataFrames 1.0, I'm not sure the benefit of trying to backport a compatability change, or even if its possible.

I will still download Pluto and take a look!

@bkamins
Copy link
Member

bkamins commented Feb 8, 2022

Try doing add [email protected] in Pluto.jl and you will see what is holding back installation of latest DataFrames.jl.

@pdeffebach
Copy link
Collaborator

I can't replicate on a fresh Pluto install. The newest versions install just fine.

My know that Pluto stores it's own Project.toml in a way that is slightly hidden from the user. So my guess is that your notebook is somewhat old, and these versions are cached.

Somehow to avoid making a breaking change, you ended up with a version of DataFramesMeta which was bad (which, again, was my fault). Try updating the packages within Pluto and see if that fixes things.

@wizofe
Copy link
Author

wizofe commented Feb 10, 2022

For the moment I skipped Pluto's reproducible approach by creating a local project and using my own toml, using the following:

begin
    import Pkg
    # careful: this is _not_ a reproducible environment
    # activate the global environment
    Pkg.activate(Base.current_project())

    Pkg.instantiate()
end

So according to the Pluto wiki apparently the toml is saved inside the Pluto notebook (either .jl or .Jmd). Interesting! I will try removing all the dependencies and test if that changes the issue. Thank you :)

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

3 participants