Skip to content

Commit

Permalink
enable summarize capabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
jas-valgotar committed Dec 18, 2024
1 parent c5d3166 commit 6ca3755
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public abstract class TableDelegationInfo
// Used to indicate whether this table has selectable columns
public SelectionRestrictions SelectionRestriction { get; init; }

public SummarizeRestrictions SummarizeRestriction { get; init; }
[Obsolete("preview")]
public SummarizeCapabilities SummarizeCapabilities { get; init; }

// Defines ungroupable columns
public GroupRestrictions GroupRestriction { get; init; }
Expand Down Expand Up @@ -268,20 +269,25 @@ public SelectionRestrictions()
}
}

public sealed class SummarizeRestrictions
[Obsolete("preview")]
public class SummarizeCapabilities
{
/// <summary>
/// List of properties that can not be summarized.
/// </summary>
public ICollection<string> NonSummarizableProperties { get; init; }

public ICollection<SummarizeMethod> NotSupportedSummarizeMethods { get; init; }

public SummarizeRestrictions()
public virtual bool IsSummarizableProperty(string propertyName)
{
return false;
}

public virtual bool IsSummarizableMethod(SummarizeMethod method)
{
return false;
}

public SummarizeCapabilities()
{
}
}

[Obsolete("preview")]
public enum SummarizeMethod
{
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public enum DelegationParameterFeatures
// $apply
Apply = 1 << 4,

// $apply = groupby((field1, ..), field with sum as TotalSum)
ApplyGroupBy = 1 << 5,

/*
To be implemented later when needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ public void PublicSurface_Tests()
"Microsoft.PowerFx.Core.Entities.IRefreshable",
"Microsoft.PowerFx.Core.Entities.SelectionRestrictions",
"Microsoft.PowerFx.Core.Entities.SortRestrictions",
"Microsoft.PowerFx.Core.Entities.SummarizeCapabilities",
"Microsoft.PowerFx.Core.Entities.SummarizeMethod",
"Microsoft.PowerFx.Core.Entities.TableDelegationInfo",
"Microsoft.PowerFx.Core.Functions.Delegation.DelegationOperator",
"Microsoft.PowerFx.Core.Localization.ErrorResourceKey",
Expand Down

0 comments on commit 6ca3755

Please sign in to comment.