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

Engine configuration for UDT supported data types

Open gregli-msft opened this issue 4 months ago • 5 comments

Currently, UDFs and UDTs have a restricted type list in UserDefinitions.cs that is not customizable per host. It includes Decimal which makes sense for Canvas but doesn't work for C# hosts. We need to generalize this.

  • Canvas doesn't want Decimal.
  • C# interpreter doesn't want TimeZoneTZInd. Crashes if used.
  • Dataverse formula columns want both of these.

This PR uses the Engine.PrimitiveTypes list, to be set by a host that cares about UDFs, UDTs, or JSON serialization. It is null by default, and if a host doesn't use these features, it doesn't matter. RecalcEngine will provide PrimitiveTypes that the interpreter can support, so any hosts using it, which is most hosts, don't need to make a change.

gregli-msft avatar Sep 11 '25 06:09 gregli-msft

Public API changes:
❌CP0002 M:Microsoft.PowerFx.Engine.set_PrimitiveTypes(Microsoft.PowerFx.ReadOnlySymbolTable)

jas-valgotar avatar Sep 11 '25 07:09 jas-valgotar

Public API changes:
❌CP0002 M:Microsoft.PowerFx.Engine.set_PrimitiveTypes(Microsoft.PowerFx.ReadOnlySymbolTable)

jas-valgotar avatar Sep 11 '25 07:09 jas-valgotar

✅ No public API change.

jas-valgotar avatar Sep 12 '25 20:09 jas-valgotar

✅ No public API change.

jas-valgotar avatar Sep 12 '25 20:09 jas-valgotar

✅ No public API change.

jas-valgotar avatar Sep 12 '25 20:09 jas-valgotar