JuliaData / JuliaData/DataFramesMeta.jl
Add another escape for things evaluated before the function definition
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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