microsoft / microsoft/Power-Fx

SortByColumns( [Float(1), Float(3), Float(2)], Value, [3,2,1] ) does not work

Open
#2,607 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.4k
Forks
358
Avg merge
10h 34m
Merged PRs (30d)
3

Description

We should be able to mix/match decimal and float numbers in the order table argument.

Some examples:

  • SortByColumns( [{A:1}, {A:3}, {A:2}], A, [3,2,1] ) - simple case, it works fine
  • SortByColumns( [{A:Float(1)}, {A:Float(3)}, {A:Float(2)}], A, [3,2,1] ) - mixing decimal / floats: doesn't work (compile-time error)
  • SortByColumns( [{A:Float(1)}, {A:Float(3)}, {A:Float(2)}], "A", [3,2,1] ) - same as above, with column name as a literal string
  • SortByColumns( [{A:Float(1)}, {A:Float(3)}, {A:Float(2)}], If(true,"A"), [3,2,1] ) - it compiles, but we get an incorrect result

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

Reproduce the four SortByColumns examples from the issue, comparing decimal values with Float values and both column-name forms. Start by tracing SortByColumns type checking and order-table handling; done means the mixed decimal/float cases compile where expected and produce the correct descending result.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.