queryverse / queryverse/Query.jl

@map followed by @replacena with a function defined using a macro

Open
#328 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

It seems that column transformation functions defined using macros can behave differently than functions defined without macros. Here's an example:

using Match, DataFrames, Query
df = DataFrame(a = [1, 2], b = [3, missing])
f(x) = @match x begin 
    3 => "three"
    _ => missing
end
df |> 
    @map({_..., c = f(_.b)}) |>
    @replacena("successfully replaced")

The output still has NAs in it, despite the final @replacena command.

If I replace f with an equivalent version without macros (even just the one obtained by expanding the macro), this works as expected.

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 by running the issue's Julia example with Match, DataFrames, and Query, focusing on the pipeline combining @map and @replacena. Compare the macro-defined function with its expanded equivalent and verify that the final output replaces all missing values.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.