JuliaData / JuliaData/DataFramesMeta.jl

silent error when using `,` in operations

Open
#320 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

consider the use of @orderby below. Look at the last example. Somehow, the syntax allows the use of , does not error, but provides an incorrect result.

julia> dd = DataFrame(a = [3, 1, 2], b = [5,4, 6])
3×2 DataFrame
 Row │ a      b     
     │ Int64  Int64 
─────┼──────────────
   1 │     3      5
   2 │     1      4
   3 │     2      6

# works correctly
julia> @orderby(dd, :a, :b)
3×2 DataFrame
 Row │ a      b     
     │ Int64  Int64 
─────┼──────────────
   1 │     1      4
   2 │     2      6
   3 │     3      5

# works correctly
julia> @orderby dd :a :b
3×2 DataFrame
 Row │ a      b     
     │ Int64  Int64 
─────┼──────────────
   1 │     1      4
   2 │     2      6
   3 │     3      5

# works silenty, but incorrect
julia> @orderby dd :a, :b
3×2 DataFrame
 Row │ a      b     
     │ Int64  Int64 
─────┼──────────────
   1 │     3      5
   2 │     1      4
   3 │     2      6

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 three @orderby examples from the issue, then inspect the @orderby macro implementation and its argument parsing. The comma-separated form should no longer silently return the unsorted result; add coverage for the examples and verify the intended error or consistent behavior.

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.