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

Implement LINQ LeftJoin and RightJoin #110872

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

roji
Copy link
Member

@roji roji commented Dec 20, 2024

Closes #110292

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-linq
See info in area-owners.md if you want to be subscribed.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 14 changed files in this pull request and generated 2 comments.

Files not reviewed (7)
  • src/libraries/System.Linq.Queryable/tests/System.Linq.Queryable.Tests.csproj: Language not supported
  • src/libraries/System.Linq/src/System.Linq.csproj: Language not supported
  • src/libraries/System.Linq/tests/System.Linq.Tests.csproj: Language not supported
  • src/libraries/System.Linq/ref/System.Linq.cs: Evaluated as low risk
  • src/libraries/System.Linq.Queryable/ref/System.Linq.Queryable.cs: Evaluated as low risk
  • src/libraries/System.Linq/tests/JoinTests.cs: Evaluated as low risk
  • src/libraries/System.Linq.Queryable/tests/JoinTests.cs: Evaluated as low risk
Comments suppressed due to low confidence (3)

src/libraries/System.Linq/src/System/Linq/RightJoin.cs:43

  • The IsEmptyArray method is not defined in the provided code. Ensure that this method is defined and works as expected.
if (IsEmptyArray(inner))

src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs:245

  • The DynamicDependency attribute should be corrected to use the format: DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Enumerable)).
[DynamicDependency("LeftJoin`4", typeof(Enumerable))]

src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs:260

  • The nullable type for q is not necessary. Use a simple cast instead: IQueryable q = source as IQueryable;
IQueryable<TSource>? q = source as IQueryable<TSource>;

};
JoinRec[] expected = {
new JoinRec{ name = "Prakash", orderID = 95421, total = 9 },
new JoinRec{ name = "Tim", orderID = 0, total = 0 },
Copy link
Preview

Copilot AI Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test case assumes that the default values for orderID and total are 0. It might be clearer to explicitly state that these are default values.

This comment was generated based on a coding guideline created by a repository admin.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@@ -440,6 +472,38 @@ public static IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this I
source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
}

[DynamicDependency("RightJoin`4", typeof(Enumerable))]
Copy link
Preview

Copilot AI Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DynamicDependency attribute should be corrected to use the format: DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Enumerable)).

Suggested change
[DynamicDependency("RightJoin`4", typeof(Enumerable))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Enumerable))]

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@roji roji requested a review from eiriktsarpalis December 20, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Introduce LeftJoin LINQ operator
1 participant