microsoft / microsoft/Power-Fx
Support Scalar Table Functions via IR transforms
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.4k
- Forks
- 358
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 3
Description
Interpreter doesn't support Trig Table Functions today
https://github.com/microsoft/Power-Fx/blob/ac5f76c2f4cc53398d424356a0ae260b87dd93d3/src/tests/Microsoft.PowerFx.Interpreter.Tests/InterpreterExpressionTestCases/Disabled.txt#L3
For 1-argument scalars, we could enable these via an IR transform:
Cos([1,2,3]) // Table overload
Could be rewritten in IR as:
ForAll([1,2,3], Cos(Value)) // ForAll around scalar overload
This can be immediately applied to enabling in interpreter:
https://github.com/microsoft/Power-Fx/blob/main/src/tests/Microsoft.PowerFx.Core.Tests/ExpressionTestCases/TrigTableFunctions.txt
Other table overloads are more complex and can be dealt with later.
| Tabular | As Scalar | Notes |
|---|---|---|
Cos(table) |
ForAll(table, Cos(Value)) |
Trivial |
Round(table, arg1) |
ForAll(table, Round(Value, arg1)) | 1 arg |
Round(table0, table1) |
??? | 2 tables, complex |
Contributor guide
No contributing guide indexed for this repository
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 with src/tests/Microsoft.PowerFx.Interpreter.Tests/InterpreterExpressionTestCases/Disabled.txt and the trig cases in src/tests/Microsoft.PowerFx.Core.Tests/ExpressionTestCases/TrigTableFunctions.txt. Trace the interpreter's IR transform entry point and how ForAll and scalar overloads are represented. Done means one-argument scalar table overloads, such as Cos(table), are enabled with passing expression tests; multi-table overloads remain out of scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100