Power-Fx icon indicating copy to clipboard operation
Power-Fx copied to clipboard

Fix Aggregate types in UDF

Open adithyaselv opened this issue 1 year ago • 2 comments

Changes behavior of aggregate types like records and tables in User Defined Functions (UDFs) Add stricter type checking (restrict allowing more fields than expected) for aggregate types in UDF argument and return.

adithyaselv avatar Dec 13 '24 19:12 adithyaselv

✅ No public API change.

LucGenetier avatar Jan 07 '25 18:01 LucGenetier

    public void CheckTypesOnDeclaration(CheckTypesContext context, DType actualBodyReturnType, TexlBinding binding)

Not related to your changes, but since you are touching this file: this function is only used in this class (8 lines above). Can you make it private?


Refers to: src/libraries/Microsoft.PowerFx.Core/Functions/UserDefinedFunction.cs:188 in 00c51ac. [](commit_id = 00c51ac12962a3bdb0744c51548ec95600a9a5d2, deletion_comment = False)

CarlosFigueiraMSFT avatar Jan 28 '25 18:01 CarlosFigueiraMSFT

✅ No public API change.

jas-valgotar avatar Jul 02 '25 22:07 jas-valgotar

    public bool AreFieldsOptional { get; set; } = false;

I know this was already there, but there is an assumption that a DType is immutable. And this breaks it - and in your test code you're using it... Not a blocker for this PR, but consider filing an issue to clean it up.


Refers to: src/libraries/Microsoft.PowerFx.Core/Types/DType.cs:217 in 944c1a4. [](commit_id = 944c1a42cb9977b869103875bc22aa46f737ca9d, deletion_comment = False)

CarlosFigueiraMSFT avatar Jul 02 '25 22:07 CarlosFigueiraMSFT