Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capabilities for Summarize() #2787

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public abstract class TableDelegationInfo
// Used to indicate whether this table has selectable columns
public SelectionRestrictions SelectionRestriction { get; init; }

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

// Defines ungroupable columns
public GroupRestrictions GroupRestriction { get; init; }

Expand Down Expand Up @@ -266,6 +269,35 @@ public SelectionRestrictions()
}
}

[Obsolete("preview")]
public class SummarizeCapabilities
jas-valgotar marked this conversation as resolved.
Show resolved Hide resolved
{
public virtual bool IsSummarizableProperty(string propertyName)
{
return false;
}

public virtual bool IsSummarizableMethod(SummarizeMethod method)
jas-valgotar marked this conversation as resolved.
Show resolved Hide resolved
{
return false;
}

public SummarizeCapabilities()
{
}
}

[Obsolete("preview")]
public enum SummarizeMethod
jas-valgotar marked this conversation as resolved.
Show resolved Hide resolved
{
None,
Sum,
Average,
Min,
Max,
Count,
}

public sealed class FilterRestrictions
{
// List of required properties
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
Loading