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

1552 Коммитов

Автор SHA1 Сообщение Дата
Luc Genetier 4adcfbdf89 WIP 2024-11-18 09:56:35 +01:00
Adithya Selvaprithiviraj 5893a462cb
Block Type literals from being used in invalid contexts (#2741)
Today we allow expressions like the following in PowerApps

```
If(Type(Boolean), 1, 2)
``` 

this PR blocks such unintended usage of type literals at compile time.
2024-11-14 14:46:56 -08:00
McCall Saltzman ff22ee8ae8
Only create one instance of Features.None/PFxV1 (#2740) 2024-11-14 19:18:49 +00:00
Luc Genetier 9a9f71ef0c
Add x-ms-enum-values management in CDP connectors (#2738)
Add x-ms-enum-values in CDP connectors
Accumulate option sets to surface them in CdpTable

Optionset names will be 'propertyName (tableName)'
If existing, propertyName will be replaced with 'x-ms-enum' value
2024-11-14 18:10:11 +00:00
Adithya Selvaprithiviraj 5c173b35db
Make TypeLiteralNode visitor abstract in TexlVisitor (#2737)
Making the `TypeLiteralNode` visitor abstract in the `TexlVisitor` to
ensure we consider handling TypeLiteralNode in future TexlVisitor
implementations. keeping it virtual sometimes made this go unnoticed.
2024-11-13 09:21:33 -08:00
rick-nguyen 3485714600
Allow for display name refresh when cloning and rebinding UDF (#2733)
This is needed for datasource display name changes if a parameter of the
UDF is a datasource type.
2024-11-12 13:24:57 -08:00
Carlos Figueira f891601ae6
Fix TimeValue function, add test (#2731)
Fixes #2674 .

The TimeValue function has a few issues, which are fixed by this change:
- Better validation (so that calls such as `TimeValue("1")` fail, as it
does in Excel
- Support for AM/PM designators (`TimeValue("6:00 PM")`), as it is
supported in Excel
- Support for wrapping hours (`Value(TimeValue("27:00:00")) =
Value(TimeValue("3:00:00"))`), as it is done in Excel
2024-11-07 13:41:39 -08:00
Jas Valgotar c5a3aeadb5
Fixes enum store when SymbolTable is replaced while setting up config (#2729)
This PR fixes the issue where inbuilt enums are no longer part of the
config if the config's symbol table is replaced after initialization.

After initializing the config if SymbolTable was replaced, we were
loosing the enums attached to the previous default symbol table. This PR
will adds a default symbol table(seprate from existing table) to handle
that.
2024-11-05 15:02:14 -08:00
McCall Saltzman 7b70dd927c
Clean up some dead code (#2730)
Found doing some cleanup on PA Client
2024-11-04 22:42:40 +00:00
Luc Genetier ae733a6733
[Compliance] use System.Text.Json 6.0.10 in Core.Tests (.Net 4.6.2) (#2727) 2024-11-04 04:39:14 -08:00
Carlos Figueira 6089c04966
Cleanup for some tests (#2695)
Removing duplication between pre-V1 and V1 tests.
2024-11-01 13:48:34 -07:00
Shpakh-MSFT e1e538183a
Added new method on IExternalRule to help with invariantexpression ch… (#2725)
On an effort to remove null rule binding, we need the ability to have an
option to apply null binding before doing the check if binding is null.
This change adds a new method on IExternalRule to help with that.
2024-11-01 13:11:10 +00:00
toshio-msft a1560ea79f
[[Power-Fx]] Localization hand-back [CTAS - RunID=20241031-195542-4p42frvtz2] (#2726)
Translation handback check-in (PR Created by automation).

---------

Co-authored-by: anderson-joyle <joyle@outlook.com>
2024-10-31 22:09:15 +00:00
Luc Genetier 7492ab166d
Remove ServiceCapabilities.FilterFunctions and TableDelegationInfo.FilterFunctions (#2724)
Those are apparently useless and were creating confusion
FilterFunctions stays at column level
2024-10-30 14:26:23 +01:00
Adithya Selvaprithiviraj bc2b841304
Error when '=' syntax is used to define UDT (#2721)
Today we allow something like `T = Type(Number)` which is incorrect and
should not be allowed . this PR adds error to that scenario

---------
2024-10-29 11:41:12 -07:00
Luc Genetier 90441fd95d
Fixes in ComposedReadOnlySymbolTable (#2720)
- OptionSets should only return first OS by name (first element wins)
- TryGetVariable not working as expected
2024-10-28 18:16:03 +00:00
Adithya Selvaprithiviraj 60bdb1b590
Fix formatting and structural printing for type literals (#2719)
Formatting , structural printing and cloning were broken for type
literals. This PR fixes these issues and adds tests to ensure the
changes work as expected.

Formatting of user definitions is still not perfect and has a bug where
it would fail if we had definitions of same kind with same name. That is
not in the scope of this PR and shall be fixed as a follow up
2024-10-25 09:52:36 -07:00
Luc Genetier 870eb39202
Add NotificationUrl to ConnectorParameters (#2717)
Based on x-ms-notification-url content/value
2024-10-23 20:44:29 +00:00
Shpakh-MSFT ca42fbc708
Added a new property on IExternalRule interface. (#2715)
As PA is moving away from rules with null binding, this PR introduces a
new property called HasValidBinding which needs to be used to check the
binding validity in future rather than Binding property itself.
Eventually we should remove the Binding property from rule to abstract
that. This change is first step towards that direction.
2024-10-23 11:03:21 -07:00
Luc Genetier 05e865efb4
Make Json serializer less strict on JSON encoding (#2714) 2024-10-23 15:03:53 +00:00
Luc Genetier f907331336
Add ExposeInternalParamsWithoutDefaultValue in ConnectorSettings to expose internal parameters without default value (#2713) 2024-10-23 16:21:23 +02:00
Luc Genetier 8f3a60bd16
Use Uri.EscapeDataString instead of HttpUtility.UrlEncode in order to… (#2709)
… generate %20 instead of +
2024-10-23 14:15:33 +02:00
Adithya Selvaprithiviraj f473c48247
Clean up User-defined type related parser flag (#2697)
* Remove `AllowParseAsTypeLiteral, AllowTypeLiteral` parser flag.
* AsType, IsType and ParseJSON overloads are part of Builtin Functions
* Add constant for Type Keyword.
* Add type arg functions to Built-in
* Refactor test
2024-10-22 10:58:51 -07:00
Luc Genetier 2434fd3faf
Fix OptionSets in symbol tables (#2705)
Make sure composed tables return all option sets
2024-10-22 16:35:49 +02:00
McCall Saltzman 37533140c9
Change Lookup order in BinderUtils.TryGetConstantValue to check entitystore first (#2703)
NameResolver.Lookup is a weirdly expensive operation when done from the
middle of a running analysis pass.
A few functions call TryGetConstantValue from CheckTypes, which is
called during analysis to get functions result types.
In JSON it was possible to move that to CheckSemantics, but in Match, we
want to avoid the expensive call to Lookup if we can, so we first look
in the EntityStore to resolve enums.

This doesn't meaningfully change the scenario for non PA hosts, as the
entity store is a PA-only concept.
2024-10-21 23:09:24 +00:00
Shpakh-MSFT c2297b1aed
As rule binding could be null, we need to make sure to check that before checking for errors/warning (#2702)
…fore checking for any error/warnings.
2024-10-21 15:21:06 -07:00
Luc Genetier 261c612eb3
Add SymbolTable AddOptionSet (#2701)
Add AddOptionSet API to SymbolTable
#1867
2024-10-21 15:47:53 +00:00
Luc Genetier 089043b341
Capabilities update (#2700) 2024-10-17 17:57:40 +02:00
Luc Genetier 6c9855ebd2
Implement missing GetColumnCapability in CdpDelegationInfo (#2698) 2024-10-16 14:21:47 +02:00
Luc Genetier 388d16a8ab
Microsoft Security Advisory CVE-2024-43485 (#2696)
https://github.com/dotnet/announcements/issues/329
2024-10-15 16:30:32 +02:00
Luc Genetier 7b7a1bb21e
Add distinct capability (#2694) 2024-10-14 20:55:16 +02:00
rick-nguyen b89656de2e
NF/UDF with Delegation warning is not passed on when NF/UDF is used (#2692)
1. UDF():DS = Filter(DS, Sqrt(Value) > 5));
2. use UDF() elsewhere, no delegation warning is shown

This has always been the case for named formulas as well, change for NF
delegation warning flag is in other repo so test cannot be written to
for that scenario.
2024-10-14 08:19:43 -07:00
Luc Genetier 0fd9e3e130
Refactor CDP implementation and add Capabilities (#2636)
Refactor CDP implementation
Use AssociatedDataSources for CDP record types
Make all CDP records lazy
Add x-ms-enum management
New TabularRecordType (lazy)
Make CdpTableResolver return ConnectorType
Remove CdpDType hack
Remove CdpTableType hack
Remove CdpTableDescriptor
Remove ExternalCdpDataSource
Remove ICdpTableResolver.GenerateADS hack
Rework Connector service capabilities
Add Relationships to CdpService
Add TableParameters to CdpTable
New InternalTableMetadata and related classes in Pfx Core
New InternalTableParameters in Pfx Core (implementing
IExternalTabularDataSource)
Fix DType ToRecord, ToTable
2024-10-11 14:35:28 -07:00
McCall Saltzman d3c93a3869
Remove binding reference for component function props (#2664) 2024-10-11 09:11:27 -07:00
Mike Stall 13fa198864
Initial support for Power Fx Modules. (#2661)
Only exposed in REPL, and must be explicitly activated.

Only new concept in core is adding **FileLocation**. We need to report
errors within a file (line,col), not just character offset in an
expression.

Also implement the Assert() function in the repl - this helps with
wrigin modules that act as unit tests.

Module support is defined via Repl. Module format is deserialized via
YamlDotNet.
Modules only support:
- a single Formulas section that behaves like app.formulas. 
- an "imports" section for importing other modules. 
The tests demonstrate the various combinations for public/private,
conflict, shadowing, etc.

Add management functions to repl:
Import(path)
DeleteModule(path) - remove from list 
ListModules() - show which moduels are loaded
2024-10-10 13:51:34 -07:00
Carlos Figueira ac3d51d049
Fix PlainText's handling of open tags (#2691)
Fixes #2679 . Currently the PlainText doesn't handle some open tags correctly - the function is supposed to convert things like &lt;br/&gt; to a new line or &lt;p&gt; to two new lines, but it is matching tags such as &lt;bra&gt; and &lt;para&gt; which should not be matched.
2024-10-10 10:09:19 -07:00
Luc Genetier d53c8425c1
Add dependabot.yml (#2682) 2024-10-10 12:07:43 +02:00
Anderson Silva 74ea07308f
Revert part of 2673 (#2678) 2024-10-08 12:12:57 -05:00
Anderson Silva 062a89718b
Environment variables helper (#2673)
Issue https://github.com/microsoft/Power-Fx/issues/2416.
2024-10-07 14:43:13 +00:00
rick-nguyen 9531d76c40
Fix mismatch return type error span for chained expression UDFs (#2654)
In chained expressions, the error for the bad return type would only
highlight the semicolon instead of the last child node of the variadic
op node.
2024-10-04 13:31:26 -07:00
rick-nguyen e5e9714c99
Clarify error and instructions when user uses behavior function in non-behavior UDF (#2653)
Add an informative error for behavior functions used in non-imperative
UDF
2024-10-03 10:33:13 -07:00
Anderson Silva 8cb65843a8
IsEmpty supports UO (#2672)
Issue https://github.com/microsoft/Power-Fx/issues/2671.
Still need to verify other functions.
2024-10-03 16:18:06 +00:00
Adithya Selvaprithiviraj 1507ae41b5
Add PowerFx feature flag for User-defined types (#2667)
Add PowerFx feature flag for User-defined types to show compile error
when a function that uses UDT type argument is used when the feature is
turned off. This PR also also fixes an error message string

I would also like to cleanup the Parser flag `AllowTypeLiteral` and use
only feature flag, but that needs bit more refactoring and will do in a
follow up PR
2024-10-03 00:42:36 +00:00
toshio-msft 77ba57001b
[[Power-Fx]] Localization hand-back [CTAS - RunID=20241002-183001-dz5bj7d1x6] (#2666)
Translation handback check-in (PR Created by automation).
2024-10-02 16:04:57 -07:00
Mari 90a489ac68
Use logical names and running a single query to get relationships (#2662)
Use logical names and running a single query to get relationships for
Azure SQL

---------

Co-authored-by: Luc Genetier <lucgen@microsoft.com>
Co-authored-by: Luc Genetier <69138830+LucGenetier@users.noreply.github.com>
Co-authored-by: Marimuthu Gurusamy <magurusa@microsoft.com>
2024-10-02 17:07:33 +00:00
Martin Costello f3a260a6b2
Fix NuGet badges (#2665)
Fix broken NuGet badges since `buildstats.info` was shuttered.
2024-10-02 17:06:17 +02:00
McCall Saltzman be19c3bf02
Make syntax localization util internal instead of private (#2663)
Working on some cleanup of localization code, and this utility is
duplicated in PA Client.
2024-09-30 11:43:53 -07:00
Adithya Selvaprithiviraj de16049af3
Change NamedType definition syntax (#2616)
Changes NamedType definitions to use `:=`
2024-09-27 17:47:50 -07:00
Luc Genetier 6a096a18c2
Add test for ZD CDP connector, using enums (#2658)
Validate that we can process option sets properly with CDP connectors
2024-09-27 07:21:44 -07:00
Carlos Figueira a5c0920366
Add new test to validate the DType always orders its fields (#2657)
Currently the tree that stores fields of a complex DType (records or arrays) stores those in an ordered way (ordinal comparison). There is some code that relies on that, so codifying it as a test to make it a "specification"
2024-09-26 14:13:51 +00:00