From f61e73d227bf6857da289d6857ad4357edc3af21 Mon Sep 17 00:00:00 2001 From: jas-valgotar Date: Wed, 18 Dec 2024 17:04:58 -0500 Subject: [PATCH] enable summarize capabilities. --- .../Entities/External/TableDelegationInfo.cs | 23 +++++++++++-------- .../Public/Values/DelegationParameters.cs | 3 +++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/libraries/Microsoft.PowerFx.Core/Entities/External/TableDelegationInfo.cs b/src/libraries/Microsoft.PowerFx.Core/Entities/External/TableDelegationInfo.cs index b9361447b2..ad0195a0d3 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Entities/External/TableDelegationInfo.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Entities/External/TableDelegationInfo.cs @@ -22,7 +22,7 @@ public abstract class TableDelegationInfo // Used to indicate whether this table has selectable columns public SelectionRestrictions SelectionRestriction { get; init; } - public SummarizeRestrictions SummarizeRestriction { get; init; } + public SummarizeCapabilities SummarizeCapabilities { get; init; } // Defines ungroupable columns public GroupRestrictions GroupRestriction { get; init; } @@ -264,16 +264,19 @@ public SelectionRestrictions() } } - public sealed class SummarizeRestrictions + public class SummarizeCapabilities { - /// - /// List of properties that can not be summarized. - /// - public ICollection NonSummarizableProperties { get; init; } - - public ICollection NotSupportedSummarizeMethods { get; init; } - - public SummarizeRestrictions() + public virtual bool IsSummarizableProperty(string propertyName) + { + return false; + } + + public virtual bool IsSummarizableMethod(SummarizeMethod method) + { + return false; + } + + public SummarizeCapabilities() { } } diff --git a/src/libraries/Microsoft.PowerFx.Core/Public/Values/DelegationParameters.cs b/src/libraries/Microsoft.PowerFx.Core/Public/Values/DelegationParameters.cs index 9e3c9db056..201ecfe559 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Public/Values/DelegationParameters.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Public/Values/DelegationParameters.cs @@ -73,6 +73,9 @@ public enum DelegationParameterFeatures // $apply Apply = 1 << 4, + // $apply = groupby((field1, ..), fileld with sum as TotoalSum) + ApplyGroupBy = 1 << 5, + /* To be implemented later when needed