Add GroupJoin overload returning IGrouping#121999
Conversation
src/libraries/System.Linq.Queryable/ref/System.Linq.Queryable.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
left a comment
There was a problem hiding this comment.
@copilot you forgot to add the corresponding IAsyncEnumerable overloads in the System.Linq.AsyncEnumerable project.
|
Tagging subscribers to this area: @dotnet/area-system-linq |
|
@copilot please invoke the code-review skill and post your analysis/results as comment on this PR |
🤖 Copilot Code ReviewHolistic AssessmentMotivation: The PR implements an approved API (issue #120587, Approach: The implementation follows the existing patterns in each project ( Summary: Detailed Findings
|
🤖 Copilot Code Review — PR #121999Note This review was generated by Copilot. Holistic AssessmentMotivation: Justified — the existing Approach: Good — the implementation closely mirrors the existing Summary: ✅ LGTM. The implementation matches the approved API shape from #120587 (including the v2 with Detailed Findings✅ API Approval Verification — Matches approved shapeIssue #120587 has the
Ref assembly entries are present for all three libraries. No unapproved public API surface detected. ✅ Implementation Correctness — Follows existing patterns
The new ✅ Test Coverage — ComprehensiveTests cover:
✅ XML Documentation — CorrectThe 💡 Suggestion — Minor:
|
|
@copilot Please fix the merge conflicts. |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/3c8768a0-ae9d-4fd7-a701-1bae8afd5817 Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Head branch was pushed to by a user without write access
|
@copilot you did not fix the merge conflicts. Please try again. |
…urn-overload Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Fixed in merge commit 72dae6c. The conflict was in |
|
/ba-g tests are passing |
This reverts commit 375857b.
@eiriktsarpalis there was a CI outage, no test was running on this. Main is now failing with Revert at #126624 |
|
@MichalStrehovsky thanks for handling the revert. I'm not sure how I slipped up here, but I take it's related to that CI outage you're referring to? |
Implements the approved API from dotnet#120587 — a simplified `GroupJoin` overload that removes the need for an explicit result selector, returning `IGrouping<TOuter, TInner>` where the outer element is the key and the correlated inner elements are the grouping contents. ## Description ### API ```csharp namespace System.Linq; public static partial class Enumerable { public static IEnumerable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, IEqualityComparer<TKey>? comparer = null); } public static partial class Queryable { public static IQueryable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, IEqualityComparer<TKey>? comparer = null); } public static partial class AsyncEnumerable { public static IAsyncEnumerable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IAsyncEnumerable<TOuter> outer, IAsyncEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, IEqualityComparer<TKey>? comparer = null); public static IAsyncEnumerable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IAsyncEnumerable<TOuter> outer, IAsyncEnumerable<TInner> inner, Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector, IEqualityComparer<TKey>? comparer = null); } ``` ### Changes - **System.Linq**: New `GroupJoin<TOuter,TInner,TKey>` overload with optional `IEqualityComparer<TKey>?` parameter + internal `GroupJoinGrouping<TKey, TElement>` wrapper class. XML doc comments with correct `<see cref="IGrouping{TOuter, TInner}"/>` references added to the new public API. - **System.Linq.Queryable**: New overload with optional `IEqualityComparer<TKey>?` parameter and `[DynamicDependency]` on `Enumerable.GroupJoin`3`. XML doc comments added. - **System.Linq.AsyncEnumerable**: Two new overloads (sync and async key selector variants) with optional `IEqualityComparer<TKey>?` parameter + internal `AsyncGroupJoinGrouping<TKey, TElement>` wrapper class. XML doc comments added. - Reference assemblies updated for all three projects. - Tests for all three projects, with `#if NET` guards in the async enumerable tests for net481 compatibility (the new `Enumerable.GroupJoin` overload and tuple-returning `Zip` are unavailable on .NET Framework 4.8.1). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> Co-authored-by: Shay Rojansky <roji@roji.org> Co-authored-by: roji <1862641+roji@users.noreply.github.com> Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com> (cherry picked from commit 375857b)
Yes, build analysis that was dismissed with
And if you were to click on any of the legs it's waiting on, you'd see:
|
Implements the approved API from dotnet#120587 — a simplified `GroupJoin` overload that removes the need for an explicit result selector, returning `IGrouping<TOuter, TInner>` where the outer element is the key and the correlated inner elements are the grouping contents. ## Description ### API ```csharp namespace System.Linq; public static partial class Enumerable { public static IEnumerable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IEnumerable<TOuter> outer, IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, IEqualityComparer<TKey>? comparer = null); } public static partial class Queryable { public static IQueryable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, IEqualityComparer<TKey>? comparer = null); } public static partial class AsyncEnumerable { public static IAsyncEnumerable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IAsyncEnumerable<TOuter> outer, IAsyncEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, IEqualityComparer<TKey>? comparer = null); public static IAsyncEnumerable<IGrouping<TOuter, TInner>> GroupJoin<TOuter, TInner, TKey>( this IAsyncEnumerable<TOuter> outer, IAsyncEnumerable<TInner> inner, Func<TOuter, CancellationToken, ValueTask<TKey>> outerKeySelector, Func<TInner, CancellationToken, ValueTask<TKey>> innerKeySelector, IEqualityComparer<TKey>? comparer = null); } ``` ### Changes - **System.Linq**: New `GroupJoin<TOuter,TInner,TKey>` overload with optional `IEqualityComparer<TKey>?` parameter + internal `GroupJoinGrouping<TKey, TElement>` wrapper class. XML doc comments with correct `<see cref="IGrouping{TOuter, TInner}"/>` references added to the new public API. - **System.Linq.Queryable**: New overload with optional `IEqualityComparer<TKey>?` parameter and `[DynamicDependency]` on `Enumerable.GroupJoin`3`. XML doc comments added. - **System.Linq.AsyncEnumerable**: Two new overloads (sync and async key selector variants) with optional `IEqualityComparer<TKey>?` parameter + internal `AsyncGroupJoinGrouping<TKey, TElement>` wrapper class. XML doc comments added. - Reference assemblies updated for all three projects. - Tests for all three projects, with `#if NET` guards in the async enumerable tests for net481 compatibility (the new `Enumerable.GroupJoin` overload and tuple-returning `Zip` are unavailable on .NET Framework 4.8.1). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com> Co-authored-by: Shay Rojansky <roji@roji.org> Co-authored-by: roji <1862641+roji@users.noreply.github.com> Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>


Implements the approved API from #120587 — a simplified
GroupJoinoverload that removes the need for an explicit result selector, returningIGrouping<TOuter, TInner>where the outer element is the key and the correlated inner elements are the grouping contents.Description
API
Changes
GroupJoin<TOuter,TInner,TKey>overload with optionalIEqualityComparer<TKey>?parameter + internalGroupJoinGrouping<TKey, TElement>wrapper class. XML doc comments with correct<see cref="IGrouping{TOuter, TInner}"/>references added to the new public API.IEqualityComparer<TKey>?parameter and[DynamicDependency]onEnumerable.GroupJoin3`. XML doc comments added.IEqualityComparer<TKey>?parameter + internalAsyncGroupJoinGrouping<TKey, TElement>wrapper class. XML doc comments added.#if NETguards in the async enumerable tests for net481 compatibility (the newEnumerable.GroupJoinoverload and tuple-returningZipare unavailable on .NET Framework 4.8.1).