queryverse / queryverse/Query.jl
@map followed by @replacena with a function defined using a macro
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
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 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