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

1556 Коммитов

Автор SHA1 Сообщение Дата
Anderson Silva c6ec4a43c7
Self visitor assert message (#2571) 2024-08-02 16:18:02 +00:00
Anderson Silva 34c6eb942c
NL structural print (#2562)
Issue https://github.com/microsoft/Power-Fx/issues/2560.
2024-08-01 22:48:20 +00:00
Adithya Selvaprithiviraj 21c14073d7
Allow UDF to return record without special syntax (#2566)
***Current State***
When Imperative UDF feature is enabled, UDF returning a record value
needs to wrap it in parenthesis (eg: `F(): Point = ({x: 5, y:5})`) to
parse it without errors.

***Fix***
* This PR adds logic to look ahead and decide between imperative
definition and record value.
* UDFs with a body containing just `{}` is considered empty record and
not imperative definition.
2024-07-30 13:55:55 -07:00
Luc Genetier ac78367be8
Fix PrettyPrintIRVisitor (#2568) 2024-07-30 17:57:37 +02:00
Carlos Figueira 582542333a
Update ErrorKind.InvalidJSON to use proper capitalization (#2565)
The newly added ErrorKind.InvalidJson should be called InvalidJSON, as JSON is an acronym and should be capitalized as in other places of the framework (such as in the ParseJSON function)
2024-07-30 05:45:36 -07:00
Navaneeth Thekkumpat 409745c076
Updating fx2nl parameters with range (#2561)
Updating fx2nl parameters with optional range. This will be utilized by
the explain this v2 feature, where range of user selection will be
passed along with the full expression.
2024-07-25 20:41:23 -07:00
Adithya Selvaprithiviraj bc081425a1
Fix: Null Handling in NodeKind Intellisense (#2552)
CurNode in IntellisenseData can be Null in different scenarios and we
have a NullNodeIntellisense Handler for this specific reason which
suggests global/ in scope Values , However this may not be applicable to
all the cases such as suggesting types for UDF.

Not handling null here forces us to have a very strict order in running
intellisense handlers , otherwise raising an exception which leads to no
Intellisense results.

It is safe for us to assume CurNode could be null and skip the current
suggestion handler instead of throwing an exception.
2024-07-23 22:28:19 +00:00
Luc Genetier d585995527
SQL CDP (#2550)
Add SQL CDP with relationships
Add foreign key discovery
2024-07-23 19:13:09 +00:00
Luc Genetier 7ae12200d7
Fix 2523 - Improve Json deserialization errors and be more permisive (#2551)
Json deserialization can be "broken" with some exceptions which are
impossible to understand for customers
This PR fixes/updates the error messages and wraps the Json
deserialization issues into an ErrorValue instead of being inconsistent
(previously, we would have an ErrorValue for invalid Json and a
NotImplementedException if there was a type mismatch between what the
connector code expects and what we got from the server)
We also accept some trivial mismatches
Add ErrorKind.InvalidJson
Add HttpExpressionError to return StatusCode in ErrorValue
2024-07-23 08:02:17 +00:00
Anderson Silva 9884992b66
Adding untyped object changes to releasenotes-1.3.0-rc.md (#2556) 2024-07-22 21:04:52 -07:00
Anderson Silva d68e6c6a3c
Set untyped object with Index function (#2548)
Issue https://github.com/microsoft/Power-Fx/issues/2502.

Supporting `Set(Index(uo,1),value)`
2024-07-22 16:28:02 -07:00
Anderson Silva 4045de74c0
Read untyped value with Index function (#2555)
Issue https://github.com/microsoft/Power-Fx/issues/2503.
This scenario is already supported. Adding test cases.
2024-07-19 06:47:16 -07:00
Anderson Silva 320ff8b39a
Escaping reserved words when suggested (#2553)
Issue https://github.com/microsoft/Power-Fx/issues/2549.
2024-07-18 10:06:48 -07:00
Anderson Silva d193162359
UO set property (#2547)
Issue https://github.com/microsoft/Power-Fx/issues/2501.
2024-07-16 04:07:30 +00:00
Navaneeth Thekkumpat 07a17a998f
Adding optional range param to custom fx2nl param (#2541)
Update the expected params for Fx2Nl (CustomFx2NLParams) with an
optional range field.
This will be used and passed down for the explain this partial formula
explanation.
2024-07-15 15:01:06 -04:00
toshio-msft 6ce7ccd514
[[Power-Fx]] Localization hand-back [CTAS - RunID=20240712-063615-16ttxdydv7] (#2544)
Translation handback check-in (PR Created by automation).
2024-07-14 20:52:12 -07:00
Luc Genetier b762be3ae8
Change OrderBy to IReadOnlyCollection (#2536) 2024-07-10 14:35:50 +00:00
Mike Stall a027f1945c
Fix nullref race in StringResources (#2531)
Fix for #2528 . See issue for description
2024-07-09 21:39:34 +00:00
Luc Genetier a9622c06db
Add OrderBy (#2530)
ODataParameters: Update OrderBy
DelegationParameters: Add GetOrderBy()
2024-07-09 21:00:48 +00:00
Anderson Silva d2201af57e
Summarize to support GUID type (#2529)
Issue https://github.com/microsoft/Power-Fx/issues/2527.
2024-07-09 15:19:26 -05:00
rick-nguyen bcc750b191
Revert change to remove hyperlinks from allowed UDF types (#2524)
Dataverse columns support hyperlink types so this is needed for
datasource types.
2024-07-08 10:32:56 -07:00
Anderson Silva 233a31a8c4
Stackoverflow when calling DType.ContainsDataEntityType (#2521)
We are extending the range for
https://github.com/microsoft/Power-Fx/issues/2456.
2024-07-05 08:36:02 -05:00
Anderson Silva d37722db85
UO field coercion (#2525)
Issue https://github.com/microsoft/Power-Fx/issues/2520.
2024-07-03 15:38:02 -05:00
Shpakh-MSFT c70286e724
Added another property on interface IExternalNamedFormula to detect reference to views in NF expressions. (#2522)
Currently the logic to detect use of dataverse views in an expression
doesn't work well when expression is abstracted under named formula.
For example,
T = Filter(Monthses, 'Monthses (Views)'.MyView);

Label1.Text = CountRows(T);

CountRows(T) is not detected currently as non-delegated expression as a
result. This change fixes that. Unit test will be added on PAClient side
for this where all of the delegation tests currently are.
2024-07-02 16:10:56 -07:00
McCall Saltzman 973929709b
Move a few unused error strings out (#2518) 2024-07-01 21:03:00 +00:00
Luc Genetier d7e04a029d
Fix RecordAndTableDTypeTests inconsistency between Debug and DebugAll (#2517)
Fix RecordAndTableDTypeTests inconsistency
Fixed "#if DEBUG" conditions which were false when Debug462/70/All is
used
Fix DType.Add behavior which is different between Debug (exception) and
Release (no exception) when we want to change the field type in a
record/table type.
2024-07-01 21:08:41 +02:00
rick-nguyen 96102b5d7c
Add warning to UDFs that shadow existing built-ins, and remove Hyperlink from allowed return types (#2516)
Discussion/review: https://github.com/microsoft/Power-Fx/pull/2506

Creating new PR b/c of pipeline failure in previous PR.
2024-06-28 16:01:18 -07:00
Carlos Figueira f700a50850
Ensure proper spans on lexer errors with surrogate characters (#2515)
The lexer doesn't return the proper span for errors with surrogate characters (e.g., `Set(🍰, 1)`). This fixes it.
2024-06-28 08:26:39 -07:00
Carlos Figueira 4eeaffc54f
Don't lock string resources if not needed (#2514)
Perf improvement for string resources. Changes from #2513 by @Robulane
2024-06-27 18:48:36 +00:00
Luc Genetier 135f46d12c
CDP - Add TryGetFieldExternalTableName API (#2510)
Add TryGetFieldExternalTableName API for CDP connectors
This API allows to know if an external table has a relationship with a
given field
TryGetFieldType API gives the same information but the key difference is
that it makes a network call to return the RecordType of the external
table, while TryGetFieldExternalTableName doesn't make any network call
2024-06-27 17:13:58 +00:00
Luc Genetier 1e28299c5e
Internal tests fixes (#2512)
This is to fix our Power Fx-ConnectorStats pipeline which was broken
since we moved to multi-.Net version testing
Have also fixed a couple of places where defective swagger files were
causing some trouble
I removed the SQL upload of results as we can't use a connection string
anymore (will have to be fixed separately)
2024-06-27 16:44:33 +00:00
Anderson Silva 3daf2eda73
Update releasenotes-1.3.0-rc.md (#2508) 2024-06-26 16:43:52 +00:00
Hoa Nguyen f77304a685
Add expression culture in NL2FxParameters (#2505) 2024-06-25 23:38:11 +00:00
Akshar 53da8f6589
Extend Script Minification to also allow removing comments (#2499)
This pr mainly focuses on extending existing script minification
functionality (or remove formatting as it is called) with an ability to
optionally removing comments. Removing comment tokens is not harmful as
those are removed from the parse tree anyways. Along the way, i found
few bugs in existing implementation of remove formatting that adds extra
spaces instead of removing those like below

![image](https://github.com/microsoft/Power-Fx/assets/25670945/cbdd4a10-364c-4f1a-8e28-4fed98843153)

I also found a bug in TexlLexer that computes overlapping spans of
tokens from LexComment() when it tries to consume preceding whitespaces
of the first comment in the formula. This was supposed to be fix last
year when this was addressed during semantic tokens work but seems like
an edge case was missed.

I am keeping all the bug fixes out of scope for now since these are very
low priority and remove formatting is not that widely used.
2024-06-25 14:23:37 -04:00
Adithya Selvaprithiviraj 5e6a970332
Add Nullcheck to GetInfo result in TryGetEntityInfo (#2500)
Getinfo may return null to certain callNodes and hence it is creating
NullReferenceException consistently as a noise. this PR fixes that
issue.
2024-06-25 10:01:30 -07:00
rick-nguyen f25ebd5767
Fix imperative UDF throwing error without closing semicolon (#2494)
`Function():Void { Set(a, 1) }` should now be valid and have parity with
`Function():Void = { Set(a, 1) }`
2024-06-20 14:11:42 -07:00
Carlos Figueira 0c4d1dc16b
Fix NullReferenceException on new IsOptionSetBackedByXXX properties (#2497)
Noticed from telemetry some NullReferenceException errors in those new properties. Adding guard to fix it.
2024-06-20 00:35:21 +00:00
rick-nguyen 404d570ba1
Limit parameters allowed in UDF (#2477)
Adds a limit of 30 parameters and test for UDF.
2024-06-19 22:59:39 +00:00
rick-nguyen 901d191666
Revert/Change TexlFunction flag name restricting use inside UDF (#2493)
`CreatesImplicitScreenDependency` is a PowerApps specific behavior to
InvokeControl functions and doesn't need to be in this class here. We
can drive IsRestrictedInsideUdfBody from that flag in PowerApps.
2024-06-19 22:11:53 +00:00
Anderson Silva 75fa623c95
Removing unnecessary code (#2496)
Issue https://github.com/microsoft/Power-Fx/issues/2461.
2024-06-19 14:24:54 -07:00
Luc Genetier ddede555b3
Connectors: Don't log column names (#2490)
When logging FormulaValue types, don't log column names in aggregated
types, enums, option sets
2024-06-19 22:07:10 +02:00
Luc Genetier 0f4dd2ba23
NullReferenceException fix (#2491)
Fix NullReferenceException in connector's code
Remove MediaType check in HttpFunctionInvoker (no need)
2024-06-19 15:26:36 +00:00
Luc Genetier dceb84bcb6
Move HttpClient to CdpTableValue and update ADS hack (#2489)
HttpClient is now passed via InitAsync function and no more required in
RuntimeConfig
Removed tabular IR rewriter and related logic
Updated ADS hack with a new approach - ADS will be update in another PR
Tested live with no side effect
2024-06-19 16:52:24 +02:00
Anderson Silva 6bcbe7da6a
Avoid stackoverflow when getting suggestions (#2488)
Issue https://github.com/microsoft/Power-Fx/issues/2456.
2024-06-18 18:30:40 -05:00
Anderson Silva e13de7e19f
Collect check semantics PA change (#2487)
PR https://github.com/microsoft/Power-Fx/pull/1964 checks for read-only
fields. Changing the condition to run this check since PA deals with
read-only fields differently.
2024-06-18 13:46:47 -05:00
rick-nguyen 77bb82cd96
Add imperative UDF flag to Formula and restricted in UDF definition flag to TexlFunction (#2482)
These flags will help drive Intellisense suggestions for imperative user
defined functions.
2024-06-18 10:51:51 -07:00
Luc Genetier cb3f0e52d8
Support for multipart/form-data (#2485)
Support for multipart/form-data and allow multiple files to be uploaded
at once
Test OpenAI connector with direct connection (Swagger v3 isn't possible
with Power Apps connectors)
2024-06-18 18:52:41 +02:00
Luc Genetier 27d8efe81e
Update ADS generation logic and add FieldNames to CdpRecordType (#2486) 2024-06-18 15:01:05 +00:00
Luc Genetier e262de7854
Fix compliance issues (#2483) 2024-06-17 17:49:06 +00:00
Mike Stall 828f49c666
Optimization for function sets (#2484)
Optimize the pattern where:
- a host calls eval many times in a loop. 
- but using the same function set in all cases, as determined by just
PowerFxConfig (with some enables).

This PR is an optimization and there shouldn't be any functional
changes. However - we should review some of the behavior around
TexlFunctionSet to enable us to pursue more comprehensive optimizations.

Today, every call to Check() will compute the function set - which
involves merging the function set from builtin functions plus the extra
ones that were enabled. This is expensive because TexlFunctionSet will
"flatten" and copy all the functions into a single list. (Contrast to
how we compose SymbolTables - which is entirely deferred).

The optimization is to allow composing that once and caching it. But
also to be sure we have correct invalidation strategy if anything
changes. Added lots more tests as I discovered interesting corner cases.

This makes the benchmark use 1/10 the working set and run 3x faster.
2024-06-17 10:09:47 -07:00