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

1556 Коммитов

Автор SHA1 Сообщение Дата
David Luong 660ded6d7a
Implement Proper (#357)
* Implement proper function and add unit tests

* Edit unit test to be lowercase

* Add non ascii unit test. Edit method signature and use EvalRunner for CultureInfo

* Acronyms shouldn't be capital after proper func, add more tests
2022-05-12 11:24:18 -07:00
Luc Genetier d5daa715d4
Change SuggestUnqualifiedEnums to true (#375) 2022-05-11 22:46:19 +02:00
Mike Stall ecd1158111
Set function (#386)
* Add Set() function  to interpreter. Just degenerates to RecalcEngine.UpdateVariable.
2022-05-11 19:05:54 +02:00
Mike Stall 28050c074b
Fix #378 (#379)
* Fix #378
If(true, OptionSet.Option1)

OptionSetValue should derive from ValidFormulaValue, not FormulaValue

* Pr feedback

Co-authored-by: Mike Stall <jmstall@microsoft.com>
2022-05-09 19:19:01 +02:00
Carlos Figueira 48600133d2
Remove RequiresErrorContext from TexlFunction (#381)
Also ignored some warnings for function definitions
2022-05-09 09:47:39 -07:00
Anderson Joyle 14d7c65a8b
Count and CountA implementations (#340)
* Count and CountA implementations

* Count and CountA error handling. Moving Count* functions tests to specific files.

* Handling rows with null values.

* Changing row validation

* Test case return type changed. Sorting count functions alphabetically.

* Sorting count functions alphabetically.

* Test case return type changed.
2022-05-06 18:23:29 -07:00
Mike Stall 4b8a3e1e7b
Move Span to the Microsoft.PowerFx.Syntax namespace. (#372)
This is a public class.
2022-05-05 12:19:48 -07:00
Vamsi Modem c2eab38439
Added a string resource for named formulas (#373)
* Initial commit

* Typo
2022-05-05 10:41:13 -07:00
Mike Stall 6b2536e491
Updates to support Dataverse. (#371) 2022-05-04 18:21:14 -07:00
Luc Genetier 76f439e825
Add 1275 tests and fix several math and text issues (#342)
Fix a bunch of .txt cases for the interpreter.
2022-05-03 14:05:06 -07:00
Mitu Goswami a6d5ca65fa
Adding few IsBlank() tests in the existing function files (#364) 2022-05-02 14:43:58 -07:00
bryancroteau-MSFT 11b821ee2a
Remove most enums from the default PowerFxConfig (#362)
* Allow public methods for changing the enum store on PowerFxConfig

* PR feedback

* Remove changes to LanguageServerTests
2022-05-02 13:43:40 -07:00
Mike Stall 615c00bffc
Add other parameter types for custom functions. Just support all types for PrimitiveValue<T>. (#366) 2022-05-02 11:52:39 -07:00
jack-work 2c2b7f68d1
Remove queue (#360) 2022-05-02 07:32:50 -07:00
Mike Stall ee82789021
Fixup internal intellisense namespaces. (#365)
* Fixup internal intellisense namespaces.

* more classes...

Co-authored-by: Mike Stall <jmstall@microsoft.com>
2022-05-01 08:44:30 +02:00
Mitu Goswami db6aac9176
Added new test files for the PowerFx functions (#363)
* Added new test files for the PowerFx functions

This commit consists of the text test files for the following functions:
If/Switch
And/Or/Not
Blank/IsBlank

* Updated If.txt file with review comments
2022-04-29 16:50:43 -07:00
Mike Stall 749ba83c0f
Fixup namespace for publics. (#361)
Massive rename of public surface area to cleanup and move to "Microsoft.PowerFx" namespace.
2022-04-29 15:10:47 -07:00
Luc Genetier c21a4fe9f8
Fix chaining issue when an error occurs (#349)
* Enable EnableExpressionChaining in PowerFx Engine

* Implement EvalVisitor for ChainingNode

* Code cleanup

* Resolving Mike's comments

* update

* Add support for parser flags to #SETUP handler

* Follow Mike's comments

* Fix merge issues

* Add WaiFor chain test

* Resolving Mike's comments

* Code cleanup

* Add UT

* update UT

* Fix chaining issue when an error occurs

* Update test project

* Update

* Update

* Update

* Update

* Update

* Quick update

* Typo

* Update BaseRunner.cs

Co-authored-by: Mike Stall <mikestall@hotmail.com>
2022-04-29 19:09:46 +02:00
Mike Stall a15b4918fb
Allow interpreter to work on any IExternalOptionSet instead of OptionSet (#353)
Allow Interpreter to work with any IExternalOptionSet - which enables it to run Dataverse option sets. 
Improve optionset support.

This enables dataverse expressions like:
 
PASS!! 'FavColor (Widgets)'.Red  --> Red
PASS!! Text('FavColor (Widgets)'.Red)  --> Red
PASS!! 'FavColor (Widgets)'.Red <> 'FavColor (Widgets)'.Blue  --> True
PASS!! 'FavColor (Widgets)'.Red = 'FavColor (Widgets)'.Blue  --> False
PASS!! 'FavColor (Widgets)'.Red = 'FavColor (Widgets)'.Red  --> True
PASS!! ThisRecord.FavColor  --> Blue
2022-04-28 17:56:35 -07:00
BruceHaley 537137aa25
Add test status badge to readme (#358)
* Add test status badge

* Cleanup
2022-04-28 15:44:54 -07:00
McCall Saltzman 187a14d889
DateDiff in IR (#356) 2022-04-28 14:15:04 -07:00
ivanradicek 569e45e89b
Expose a couple more internals (#294)
Make more things public.
Introduce a FunctionInfo to wrap a TexlFunction (similar to how FormulaType wraps DType). Only exposes limited information  - will followup on what to do about types.
2022-04-27 12:37:34 -07:00
BruceHaley 3d15ca65a2
Finalize code coverage reporting (#350)
* Point badge to main branch
* Upgrade to coveralls.net 3.0
2022-04-27 11:18:32 -07:00
Emily H f93561b048
Build warning fixes (#346)
* Fixes warnings

* Added a variable back in
2022-04-27 09:46:56 -07:00
BruceHaley cdb27de507
Add PublishToCoveralls.ps1 and coverage badge (#348)
* Add PublishToCoveralls.ps1

* Add coverage badge to readme
2022-04-27 07:23:07 -07:00
Mike Stall 51bb95104c
Allow custom functions to be overloaded. (#347)
Allow custom functions to be overloaded.

Turns out the conflict was unnecessary - using a Dict with a name key when a HashSet was sufficient. 
This relies that TexlFunctions have object reference equality and we don't add the same function instance multiple times. .
2022-04-26 16:34:50 -07:00
Emily H 12b5637caf
XML fixes to eliminate warnings (#345)
* Fixed XML

* xml fixes

* xml fixes

* merge conflict fix

* merge conflict fix
2022-04-26 13:38:20 -07:00
Luc Genetier 70062eab17
Enable EnableExpressionChaining in PowerFx Engine (#322)
Enable EnableExpressionChaining in PowerFx Engine
* Implement EvalVisitor for ChainingNode
* Code cleanup
* Add support for parser flags to #SETUP handler
2022-04-26 00:13:02 -07:00
Mike Stall 6a4d1541f0
Allow public derivations from RecordValue (#339)
Enable public hosts to derive from RecordValue.
RecordValue doesn't need an IRContext (which is private), just a Type.

* Make RecordValue.TryGetField abstract. Else we had a circular reference between Fields and TryGetField.
add more tests.

Remove InMemoryRecordValue.PropagateFieldType. This was injecting deep copies of RecordValues into the expressions, and that would implicitly convert derived RecordValues into
 InMemoryRecordValue. Also move into the base class so that derived classes don't worry about it.  InMemoryRecordValue is now a trivial implementation.

* add more runtime validation to ensrue host implements TryGetField() properly.
2022-04-25 20:19:20 -07:00
McCall Saltzman 525902e80c
Move config option on INameResolver to a new BindingConfig type (#313)
* Start

* Move flags to config
2022-04-25 16:36:37 -07:00
David Luong 1ef35f0434
Implement Shuffle (#335)
* started shuffle

* Add unit test

* Use static random & edit unit test

* Edit test case

* Changed checkFunctionCounts to point to another func

* Add more unit test & change method signature.
2022-04-25 12:03:30 -07:00
Om Prakaash e42699a977
Statistical Functions(StdevP, StdevPT, VarP, VarPT) implementation. (#327)
* Statistical Functions(StdevP, StdevPT, VarP, VarPT) implementation.

Implemented some statistical functions in the interpreter.

* Moved tests into new files and improved error handling for VarP and StdevP

* Used FiniteChecker for error-handing in VarP and StdevP functions
2022-04-23 23:04:38 -07:00
Luc Genetier 4f0bd6a813
Fix binary op when types don't match (#337)
* Fix binary op when types don't match
* Added support for eq and neq operators
2022-04-22 22:43:02 +02:00
McCall Saltzman d79caebb20
remove unneeded publics (#333) 2022-04-21 11:00:01 -07:00
bryancroteau-MSFT 4a21731afb
Add the FormulaSet class (#331)
* Add the FormulaSet class

* Update public surface tests

* Add basic unit test

* Add IDependencyFinder

* Update public surface tests again

* Add support for cycles and results in topological sort

* Mark FormulaSet as sealed

* Make FormulaSet internal
2022-04-20 18:14:07 -07:00
Mike Stall 4af647f3e3
Fixes to enable SQL parser - it depends on CheckResult. (#334) 2022-04-20 17:46:13 -07:00
Juan Osorio 85fbcf4bf9
Implement Date and DateTime for Sort (#332)
Co-authored-by: Juan Osorio <juosori@microsoft.com>
2022-04-20 14:03:22 -07:00
jelopezf c32eac0fe5
Convert non-space white space characters to spaces in DNames (#285)
* convert special whitespace characters to spaces

* test

* lint issues

* LF

* pr concerns
2022-04-19 17:04:55 -07:00
Mike Stall 8e44396dd2
Expose ParseResult. (#319)
* Expose ParseResult.

This was a bit non-trivial because:
1. Use existing ParseResult class rather than create a new one. The existing FormulaClass doesn't have the right surface and is kept internal.  PAClient uses FormulaClass, not ParseResult.
2. Have consistency between CheckResult and ParseResult, particularly around error handling
3. consistent semantics of null vs empty enumerables.
4. Consistent error vs. warning settings - creating a default ErrorObject leaves the severity enum empty which defaults to warnings.
5. Needed to allow ParserOptions.
6. added some xml comments
7. There are multiple error objects. (public vs. internal) and need to expose public ones for ParseResult, but keep internal accessible for unit tests.

Add some tests.

* PR feedback
2022-04-19 16:56:05 -07:00
Mike Stall a6b8fe7408
Add 6000+ new .txt tests written by Mitu. (#324)
Many of these don't pass yet, so putting in a "NotYetReady" directory and we'll migrate to ExpressionTestCase dir as we verify they pass.

Add unit test to verify they at least all parse, and fix some parser issues.

Tests written by @mitugm14.
2022-04-19 11:12:21 -07:00
Anderson Joyle 6c245c2234
DeleteFormula implementation (#318)
* DeleteFormula implementation

Adding the ability to delete formulas from the formulas dict.

* DeleteFormulas test cases

* Delete dependencies

* Extra tests
2022-04-18 21:34:47 -07:00
bryancroteau-MSFT 3b8c6449fe
TopSort for future multi-formula sort feature (#320)
* Initial work on a multi-formula sort feature

* Isolate TopSort as it's own change
2022-04-18 16:09:50 -07:00
McCall Saltzman 8f4ee9629a
Removes QPS-PLOC locale (#312)
Co-authored-by: Carlos Figueira <carlosff@microsoft.com>
2022-04-16 09:56:02 -07:00
McCall Saltzman c810538e1d
Repair merge issue (#314) 2022-04-15 17:31:22 -07:00
rick-nguyen e6af457ec4
Fix DType.MaxDepth no elements exception (#288)
* initial commit

* testing
2022-04-15 15:01:04 -07:00
McCall Saltzman bb8bc7084c
Fix ErrorResource locale bug (#311)
Basic strings looked up using the correct locale, but error resources were using the fallback. This fixes the issue and adds a test to catch that.
2022-04-15 13:36:52 -07:00
bryancroteau-MSFT e0fbaaa627
Implement CountRows_UO function (#310) 2022-04-15 10:21:38 -07:00
Luc Genetier e71fd87ae0
Ensure tests are run using EN-US locale (#289)
* Ensure tests are run using EN-US locale
2022-04-15 00:09:44 +02:00
McCall Saltzman 21b4ff4c14
Compile string resources into satellite assemblies to reduce assembly size (#305)
All our resources were compiled into PowerFx.Core prevously. This splits them out into satellite assemblies, and uses ResourceManager to load the appropriate resource assembly on demand. See https://docs.microsoft.com/en-us/dotnet/api/system.resources.resourcemanager for more details

Before:
8984 KB

After:
785 KB
2022-04-14 12:51:25 -07:00
Anderson Joyle 3ed36fd034
Changes to mod() function (#307)
* Issue #263

Fixing part of issue #263

* Adding test for issue #263

Filter expression should include a Blank() element in position 3 (1..n).

* Adding test case for issue #263

Fixing part of issue #263

* Removing test case for issue #263

Moved the test case to https://github.com/microsoft/Power-Fx/blob/main/src/tests/Microsoft.PowerFx.Core.Tests/ExpressionTestCases/FilterFunctions.txt

* Changing mod() function calculation

Moving the code to behave like Excel.

* Create Mod.txt

Expressions to support mod() function test cases
2022-04-14 11:42:51 -07:00