Граф коммитов

915 Коммитов

Автор SHA1 Сообщение Дата
Mike Stall 2df963bec1
Fix #1266 (#1273)
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>
2023-03-30 00:23:02 -07:00
toshio-msft a796b78044
[[Power-Fx]] Localization hand-back [CTAS - RunID=20230328-194053-jjqr1veym1] (#1269)
Translation handback check-in (PR Created by automation).

Co-authored-by: Mike Stall <mikestall@hotmail.com>
2023-03-29 16:31:54 -07:00
McCall Saltzman e3717617e4
Normalize line endings in connector intellisense tests (#1276)
Co-authored-by: Greg Lindhorst <gregli@microsoft.com>
2023-03-29 11:56:54 -07:00
Hoa Nguyen 3269bd7d37
Add Id property to User object (#1277) 2023-03-29 10:32:29 -07:00
Carlos Figueira 513efbc574
Add Left/Right/Mid/Substitute tabular implementations to the interpreter (#1259)
Some functions that were missing in the interpreter
2023-03-29 06:58:17 -07:00
Carlos Figueira 3aa196953e
Remove enums that are not used in Power Fx (#1254)
The Power Fx project has lots of enums that are only used in Power Apps; this removes them from this repository, and will be moved to the next one.
2023-03-28 16:06:36 -07:00
Luc Genetier a493d20e89
Connector Wizard (#1267)
Implement connector GetParameter APIs containing dynamic Intellisence
capabilities
2023-03-28 19:01:50 +02:00
manuelmillot 6d11c6629f
Introduce 5 icons to be used for status of canvas apps offline sync. (#1243)
Adding 5 enums for icons to be created in Power Apps.
2023-03-28 16:08:04 +02:00
jelopezf 90e43908f1
Enable async delegation (#1264)
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).
2023-03-27 16:49:01 -07:00
Hoa Nguyen ffd33c7eb2
Support DateTimeFormat.UTC in Text (#1246)
Fix issue: https://github.com/microsoft/Power-Fx/issues/1240
2023-03-27 14:38:50 -07:00
Luc Genetier 3cddde71f3
Remove dead code (#1233)
Remove HasField and HadFieldLogical APIs
Those aren't used by PA Client
2023-03-24 22:23:36 +01:00
Luc Genetier a3afc8df37
Update txt files and small code improvements (#1239)
Move ~150 working tests from NotYetReady TXT files to regular TXT files
Remove duplicates
Small code improvements
2023-03-24 21:55:47 +01:00
Anderson Silva a7c878ac12
Support DataEntity type within mutation functions (#1245)
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.
2023-03-23 16:37:16 -07:00
Greg Lindhorst 0992c4e31a
Add IR printing with type and Import improvements to Console REPL (#1231)
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.
2023-03-23 14:32:51 -07:00
McCall Saltzman f729504abb
Fix StronglyTypedEnum use of DTFormat enum in Text Function (#1242)
fixes #1241
2023-03-23 09:35:55 -07:00
Carlos Figueira 3a37d3d35e
Update .txt tests to use the features enabled in Power Apps by default (#1228)
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.
2023-03-23 07:44:38 -07:00
Carlos Figueira 1183addf08
Restrict IsEmpty arguments to tables only (#1236)
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.
2023-03-22 23:02:20 -07:00
Mike Stall e0ff255767
don't fail on passing a polymorphic type through. (#1238)
Co-authored-by: Mike Stall <jmstall@microsoft.com>
2023-03-22 22:27:17 -07:00
Mike Stall 77a8136576
Expose NamedFormula Parsing so that test site can consume it. (#1223)
Will be superseded by #1165.

Fix race discovered via  test site., Fix #1208

Co-authored-by: Mike Stall <jmstall@microsoft.com>
2023-03-22 15:04:38 -07:00
Anderson Silva 0ee5c478ce
Moving EncodeUrl function to Builtin folder (#1215)
Moving EncodeUrl function file to Texl/Builtins folder, where other builtin functions live.
2023-03-22 13:59:17 -07:00
Carlos Figueira 72b2496154
Add TexlTest for Error function (#1234)
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.
2023-03-22 09:26:49 -07:00
Luc Genetier 028ea002e4
Move ModT function declaration to SimpleFunctionMultiArgsTabularOverl… (#1232)
…oadImplementations
2023-03-22 14:12:06 +01:00
Jas Valgotar 948f8527d3
Introduces a new Void type so that we can remove IsArgTypeInconsequential (#1113)
- 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
2023-03-21 22:04:10 -04:00
toshio-msft 58718084b4
[[Power-Fx]] Localization hand-back [CTAS - RunID=20230321-212446-sjpcanekt5] (#1225)
Translation handback check-in (PR Created by automation).

Co-authored-by: Mike Stall <mikestall@hotmail.com>
2023-03-21 17:27:27 -07:00
Hoa Nguyen b862e54dbe
Change UserInfo to User for user object (#1224)
Follow https://github.com/microsoft/Power-Fx/pull/1214
2023-03-21 16:40:31 -07:00
Hoa Nguyen 8aa884b1af
Allow the string-to-number coercion in Error function (#1206)
Fix issue: https://github.com/microsoft/Power-Fx/issues/1203
2023-03-21 09:34:58 -07:00
Luc Genetier efbd04a740
Add connector x-ms-dynamic-values management (#1222)
This is used in intellisense, for proposing, for example, stored
procedure paramater names in SQL connector
2023-03-21 16:27:12 +01:00
Hoa Nguyen 7273dc9ed5
Add user object (#1214)
Fix issue: https://github.com/microsoft/Power-Fx/issues/1114
2023-03-20 21:37:02 -07:00
Luc Genetier f2070da009
Fix ModT errors (#1220)
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.
2023-03-20 20:49:57 +01:00
Luc Genetier 741ec4b3e1
Tabular Dec2Hex doesn't work with coercion (#1218)
Dec2Hex(["10","255","-16"]) works correctly in Canvas, returning ["A",
"FF", "FFFFFFFFF0" ] as it should
2023-03-20 17:40:57 +01:00
Hoa Nguyen 04663099d5
Add default language and test (#1202)
Fix issue: https://github.com/microsoft/Power-Fx/issues/1195
2023-03-17 13:32:13 -07:00
Luc Genetier c7a9086f42
Optimize CreateOptionSetType (31% perf improvement on PvaRecalcEngineConstructorWith10KOptionSets) (#1211)
Current

|                                      Method |     Mean |
|-------------------------------------------- |---------:|
| PvaRecalcEngineConstructorWith10KOptionSets | 478.0 ms |
|                        PvaRecalcEngineParse | 153.5 ms |
|                        PvaRecalcEngineCheck | 272.4 ms |


With optimization

|                                      Method |     Mean |
|-------------------------------------------- |---------:|
| PvaRecalcEngineConstructorWith10KOptionSets | 329.9 ms |
|                        PvaRecalcEngineParse | 141.7 ms |
|                        PvaRecalcEngineCheck | 239.2 ms |
2023-03-17 20:11:06 +01:00
Mike Stall bb62ded929
Revert "Introduce 5 icons to be used for status of canvas apps offline sync." (#1210)
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.
2023-03-17 10:00:41 -07:00
justinpark0916 7b75a3efc6
Add EncodeURL function (#1194)
Issue #1002 
This adds `EncodeUrl` functionality. The description of the function is
described in [this
document](https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-encode-decode).

The expected values on the test files are from PowerApps' EncodeUrl
result and the test is checking if they are providing the identical
result.
2023-03-17 11:34:53 -05:00
Vamsi Modem 676c08e3ff
Avoid double parsing UDF body (#1192)
Avoid double parsing UDF body. 
Added TexlNode for the body in the UDFDefinition that can be used later
on.
2023-03-17 09:11:37 -07:00
manuelmillot 0dff96e52e
Introduce 5 icons to be used for status of canvas apps offline sync. (#1198) 2023-03-17 00:26:32 +01:00
Jas Valgotar cb9f4e4b6e
Fixes 1187 Adds ability to add host object. (#1196)
Fixes #1187
2023-03-16 18:22:37 -04:00
Luc Genetier 0fdb6a9797
Suggest fix (#1200)
Takes advantage of the Culture to sort results properly. Fixes sorting as well.
2023-03-16 12:51:39 -07:00
Hoa Nguyen 9521929bcb
Allow multiple expected types (#1166)
Fix issue: https://github.com/microsoft/Power-Fx/issues/1125
2023-03-16 11:03:18 -07:00
Luc Genetier 2cace9a65b
Connectors, add support for SQL server with dynamic intellisense (#1193)
Add support for x-ms-dynamic-values swagger extension
2023-03-15 18:13:23 +01:00
Carlos Figueira d34bbcfc52
Update resource to remove unqualified enum references (#1190)
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.
2023-03-14 15:22:11 -07:00
Greg Lindhorst a511d313f8
Enabling table versions of RoundDown, RoundUp, and Trunc (#1178)
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.
2023-03-14 13:43:51 -07:00
toshio-msft 9c8f6f34da
[[Power-Fx]] Localization hand-back [CTAS - RunID=20230314-154741-4zwvcv1ez1] (#1186)
Translation handback check-in (PR Created by automation).

Co-authored-by: Mike Stall <mikestall@hotmail.com>
2023-03-14 13:05:52 -07:00
McCall Saltzman f11ba50c39
Ensure custom enum symbol names in intellisense suggestions are escaped (#1171)
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.
2023-03-14 09:59:43 -07:00
Mike Stall b36553fa83
Fix #918 and add test case showing separate Parse and Error culture. (#1185)
A few stronger asserts in CheckResult.

---------

Co-authored-by: Mike Stall <jmstall@microsoft.com>
2023-03-14 08:39:24 -07:00
McCall Saltzman 075eeec370
Fix error message to use correct type for option set config errors (#1184) 2023-03-13 16:08:56 -07:00
McCall Saltzman 5550a18c14
Ensure OptionSetValueType uses IExternalOptionSet's TryGetValue (#1181) 2023-03-13 15:36:15 -07:00
Jas Valgotar 9c2c012f54
FormulaValue.FromJson incorrectly Parsed heterogenous JSON arrays. (#1180)
Fixes #826
2023-03-13 11:37:50 -04:00
Luc Genetier 8850cb940a
Quick fix to resolve CA1065 error in latest changes (#1174) 2023-03-10 18:02:58 +01:00
Carlos Figueira fffe825c79
Fix IR context return type for blank values in standard error handling (#1168)
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.
2023-03-10 08:24:03 -08:00