Skip to content

Draft: Fix wrong group count if GroupInterval is specified - #737

Draft
JaleChaki wants to merge 1 commit into
masterfrom
T1334349
Draft

Draft: Fix wrong group count if GroupInterval is specified#737
JaleChaki wants to merge 1 commit into
masterfrom
T1334349

Conversation

@JaleChaki

Copy link
Copy Markdown
Contributor

Bug

DataSourceLoader returns an incorrect group count if the GroupInterval is specified. The code snippet below demonstrates how to reproduce the bug.

var loadResult = await DataSourceLoader.LoadAsync(dbContext.SomeDbSet, new LoadOptions() {
    Group = [
        new GroupingInfo {
            Selector = "DateTimeField",
            GroupInterval = "year",
            IsExpanded = false
        }
    ],
    RemoteGrouping = true, // required
    RequireGroupCount = true,
    Skip = 1 // required
});

// expected: number of group intervals
// actual: number of unique "DateTimeField" values
Console.WriteLine(loadResult.groupCount); 

Fix

The DataSourceExpressionBuilder.BuildGroupCountExpr() method now checks the grouping interval. If a grouping interval is defined, it uses remote grouping expression mechanism instead of SelectCompiler

@JaleChaki JaleChaki added bug .NET Pull requests that update .net code labels Aug 31, 2026
@JaleChaki JaleChaki changed the title Fix wrong group count if GroupInterval is specified Draft: Fix wrong group count if GroupInterval is specified Aug 31, 2026
@JaleChaki
JaleChaki marked this pull request as draft August 31, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug .NET Pull requests that update .net code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant