Test only update. Fix#1266 - Catch OperationCanceledException, not just
TaskCanceledException
---------
Co-authored-by: Mike Stall <jmstall@microsoft.com>
Co-authored-by: Luc Genetier <69138830+LucGenetier@users.noreply.github.com>
This feature looks to enable async and impure node delegation as long as
Features are enabled for it.
Additionally, removes the ICustomDelegationFunction interface in favor
of overriding the delegation validation strategy in some functions to
always delegate async calls of the function for appropriate functions
(i.e. current behavior of AsType or User function in Power Apps).
To support https://github.com/microsoft/Power-Fx-Dataverse/issues/102.
Problem: Power Fx Dataverse would crash when we tried to Collect/Patch a
record with a non-existing column. A new validation was placed to
prevent this from happening. This validation checked if a column with
the same name and type what present. If false, the mutation function
returned an error. This new validation could not compare a LookUp field
(Dtype.DataEntity) and a record type.
Solution: Expand the DataEntity type into a Record type and then compare
the types.
Adds a pseudo-function IR() to the REPL which is very handy to see the
IR for an expression. Added type information which is also very handy to
have. Note that the expression does not need to be quoted.
```
> ForAll([1,2,3], Mid("World", Value, 1))
["W", "o", "r"]
> IR( ForAll([1,2,3], Mid("World", Value, 1)) )
ForAll:*[Value:s], Scope 1(Table:*[Value:n]({Value: 1:n}, {Value: 2:n}, {Value: 3:n}), Lazy(Mid:s("World":s, ScopeAccess(Scope 1, Value), 1:n)))
```
Totally open to feedback on the new format.
All changes here are not Power Fx maker facing. This change opens up a
small amount of public surface area CheckResult.PrintIR() which returns
the IR pretty printing. I don't think this would be an issue, but wanted
to call it out.
Also adds a second argument to Import to write out the results of the
run. Can be used to feed REPL with a raw list of tests, and it will emit
the correct output for making it into a test .txt file.
ReflectionFunction was changed to support more than one function with
the same name, providing the ability to do parameter overloading, used
here for a 1 arg and 2 arg version of Import.
We currently have tests that run in Power Fx but are being ignored in Power Apps, because the JS runner doesn't understand some of the #setup directives. This updates the tests to use the same defaults as Power Apps, so that the tests won't have any setup directives, and will run properly in the Power Apps repository.
IsEmpty is supposed to check if a table is empty or not, but currently it accepts different types of arguments. Since it doesn't make sense to use it for other types, we will restrict it. But to avoid breaking Power Apps, we will make the change behind a new feature.
Also adding the implementation to the C# interpreter.
We recently had a bug added to the Error function (in #1206), and it was fixed in the next commit (#1224). This adds some additional tests to prevent the error from happening in the first place.
- Fixes https://github.com/microsoft/Power-Fx/issues/1092 and #843
- Corresponding PA PR:
https://msazure.visualstudio.com/OneAgile/_git/PowerApps-Client/pullrequest/7705536
- Introduces new `void` DType and corresponding `VoidValue` which
currently is only produced by the `If` function when argument type
mismatches (useful for behavior function) and removes
IsArgTypeInconsequential hackery.
Notes:
- `Void` type is denoted by `-`.
and it has a corresponding `VoidValue` even though it may sound
counterintuitive. This keeps things straightforward.
- `Void` type can't be consumed. Ie `void + 1` is invalid.
- `Void` type isn't allowed in the aggregate type. Ie `[void]` or
`{field: void}` is invalid.
- `Void` type can't be accepted by any type or coerced to any type.
- Currently, this PR is limited only to the `If()` function, the `Void`
type would be leveraged with other functions like `IfError()` &
`Switch()` in separate follow-up PRs.
Breaking Changes:
**Things that used to be illegal, that are now legal:**
- These kinds of previously failing cases would pass now,
e.g. `If(true, {x:3}, 1)`.
But it is safe since the eval of above would be `VoidValue` (practically
null). And which can't also be consumed.
Language breaking changes
**Things that used to be legal and are now illegal:** None
**Things that used to be legal still is legal, but behave differently:**
- The expected type of expression would change to `Void` Type.
e.g.
https://github.com/microsoft/Power-Fx/pull/1113/files#diff-9b837be0ccd7fa3b97c4cbdd5e2e022d26543e3b2ae811b0f7fd0fbd906c8dcbR506
Would have returned the type `number` earlier, which is now `Void`.
- Error may change in certain circumstances. (Since now `If` itself
doesn't produce the error, rather the consumers do)
https://github.com/microsoft/Power-Fx/pull/1113/files#diff-93bb6d92ab7000b8d30b8fa252ce068cdd0f8b1319cddf68d6a30e8dd5613ae6L25
Mod(4,[1,3]) returns [0,1] in Canvas
... but it returns Error 6-11: Invalid argument type (Table). Expecting
a Number value instead. Error 0-12: The function 'Mod' has some invalid
arguments.
Reverts microsoft/Power-Fx#1198
Causing some failures in PAClient:
Server debug failure: All enum options should exist in the
categorization map. Callstack: at System.Environment.get_StackTrace()
Turns out original change is breaking internal afterall, so we need a
PAClient PR for it.
Following the change to remove support for unqualified enums, we need to update the parameter description for the Sort[ByColumns] argument that controls the sort order, and the Date[Add|Diff] ones that determines the units to use in the addition / difference.
The single column table versions of RoundDown, RoundUp, and Trunc were
implemented, but never added to the interpreter's Library.cs. They work
in Canvas and I see no reason not to have them here too.
As none of our builtin enum names are escaped, we have a gap around
suggestions, where if a custom enum is created, it isn't properly
escaped in the intellisense suggestions. This only applies to canvas,
for PCF custom enums. Every other use case is on Option Sets.
The StandardErrorHandling class handling of blank values is overriding
the return value from the IR context, causing an error in scenarios
where the actual type is important.