microsoft / microsoft/Power-Fx

Coercion from number and Boolean/Text backed option sets is not consistent

Open
#2,229 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

Boolean and Text are supported, but not numbers. We should consider expanding this. Dataverse allows the setting of these numbers and it may be useful for range comparisons, among other uses.

Likely involve changes similar to line 351 of BinderUtils.cs in CheckTypeCore where there is an exception for Boolean, and line 1267 of BinderUtils.cs in CheckBinaryOpCore for the And/Or operators where OptionSet is listed as a valid data type.

https://github.com/microsoft/Power-Fx/blob/036cfa25838e44159ce1bebb3a879231c68d768e/src/libraries/Microsoft.PowerFx.Core/Binding/BinderUtils.cs#L351

https://github.com/microsoft/Power-Fx/blob/036cfa25838e44159ce1bebb3a879231c68d768e/src/libraries/Microsoft.PowerFx.Core/Binding/BinderUtils.cs#L1267

Tests in RecalcEngineTests.cs will also need an update.

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 in src/libraries/Microsoft.PowerFx.Core/Binding/BinderUtils.cs, reviewing the CheckTypeCore area around line 351 and CheckBinaryOpCore around line 1267. Then inspect the related cases in RecalcEngineTests.cs. Done means numeric coercion for option sets is handled consistently with the existing Boolean and Text cases and the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Feature
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.