queryverse / queryverse/Query.jl

Extensible query operations/commands

Open
#237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
403
Forks
48
Avg merge
3d 6h
Merged PRs (30d)
6

Description

Hi David,
Let's continue the discussion based on that post of Julia Discourse.

You did misunderstand what I mean, but after a sufficient sleep I found my previous comment could be a little vague because you call something like @take and @drop a command . And what I actually mean is about

  • Is there a way to define our custom command(what you refer to as the standalone query command)

  • If not such a chance, could/should we bring this into Query.jl?

e.g., we can implement an extension command to provide such a

@extension_command function apply_col(df,  mapper :: Pair{Symbol, F}) where F <: Function
       update_col, func = mapper
       col_names = names(df)
       map(col_names) do col_name
         if col_name !== update_col
             col_name => df[col_name]    
         else
             col_name => map(func, df[col_name])
         end
       end |> x -> DataFrame(x...)
end

df |> 
   @apply_col(:x => x -> x  > 20 ? 0.5x : -2x) |>
    ...

I know that it could be implemented via @select but, extensibility could be attractive.

Contributor guide

Open the contributing guide

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 with the linked Julia Discourse discussion and inspect Query.jl's existing standalone query commands, including @take, @drop, and @select. Determine whether users can define custom commands such as the proposed @apply_col, and clarify whether supporting that extension belongs in Query.jl. Done should include a decided scope and an agreed user-facing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.