JuliaData / JuliaData/DataFramesMeta.jl

Add another escape for things evaluated before the function definition

Open
#308 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
496
Forks
56
PR merge metrics
No merged PRs in 30d

Description

You often see

@rsubset df :a in Set([1, 2])

this is super slow because you have to make Set([1, 2]) evaluated every time.

The following works

julia> transform(df, let 
           y = 1
           :a => (t -> t .+ y) => :c
       end)
1×3 DataFrame
 Row │ a      b      c     
     │ Int64  Int64  Int64 
─────┼─────────────────────
   1 │     1      2      2

julia> y
ERROR: UndefVarError: y not defined

We could add some sort of escape character, like ^ or $ for things that get evaluated before the function is defined.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the @rsubset example and comparing it with the working transform(let ...) example in the issue. Before implementation, determine the intended escape syntax and its evaluation semantics with maintainers; done should include a documented syntax and tests showing values such as Set([1, 2]) are evaluated before the function definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.