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

The broadcast pipe operator doesn't get recognized by the @df macro #540

Open
bertulli opened this issue Jun 22, 2023 · 0 comments
Open

Comments

@bertulli
Copy link

Hi all!

I found this error:

    @df df_pair_temp zip(cols(instruction_pair_first_sym), cols(:first_encoding)) |>
    collect .|>
    x -> x

raises

julia> @df df_pair_temp zip(cols(instruction_pair_first_sym), cols(:first_encoding)) |>
           collect .|>
           x -> x
ERROR: UndefVarError: `.|>` not defined
Stacktrace:
 [1] (::var"#57#59")(390::DataFrame)
   @ Main ./none:0
 [2] top-level scope
   @ REPL[41]:1

I thought maybe the @df macro is disturbing something, as I get:

julia> @macroexpand @df df_pair_temp zip(cols(instruction_pair_first_sym), cols(:first_encoding)) |>
           collect .|>
           x -> x
:(((var"##394"->begin
          ((var"##range#395", var"##range#396"), var"##397") = (StatsPlots).extract_columns_and_names(var"##394", instruction_pair_first_sym, :first_encoding)
          (StatsPlots).add_label(["zip(cols(instruction_pair_first_sym), cols(first_encoding)) |> collect", "x->begin\n        #= REPL[42]3 =#\n        x\n    end"], .|>, zip(var"##range#395", var"##range#396") |> collect, (x->begin
                      #= REPL[42]:3 =#
                      x
                  end))
      end))(df_pair_temp))

Notice the .|> interpreted as a variable (if I understood it correctly).

Thanks!

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

1 participant