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 abc6e9e commit ae37514
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.CodeAnalysis;
Expand All @@ -22,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]
public SummarizeCapabilities SummarizeCapabilities { get; init; }

// Defines ungroupable columns
public GroupRestrictions GroupRestriction { get; init; }
Expand Down Expand Up @@ -264,20 +266,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 ae37514

Please sign in to comment.