***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.
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)
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.
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.
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
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.
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.
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.
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
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)
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.
`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.
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
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)
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.