Add regression tests for nested $filter/$orderby in $expand without entity set #3453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues
This pull request fixes #3447.
Description
The reported issue described
ArgumentNullExceptionwhen parsing nested$filteror$orderbyin$expandfor unbound functions without entity set path:Investigation findings: The current implementation in
SelectExpandBinder.CreateBindingStatealready handles this correctly. The conditionif (targetNavigationSource == null && elementType == null)only returns null when both are null. In expand scenarios,elementTypeis always derived from the navigation property type, so binding proceeds successfully even without navigation sources.Changes: Added 4 regression tests to prevent future regressions:
ExpandWithNestedFilterWorksWithoutEntitySetExpandWithNestedOrderByWorksWithoutEntitySetExpandWithNestedFilterAndOrderByWorksWithoutEntitySetNestedExpandWithFilterWorksWithoutEntitySetChecklist (Uncheck if it is not completed)
Additional work necessary
None required.
Repository notes
Team members can start a CI build by adding a comment with the text
/AzurePipelines runto a PR. A bot may respond indicating that there is no pipeline associated with the pull request. This can be ignored if the build is triggered.Team members should not trigger a build this way for pull requests coming from forked repositories. They should instead trigger the build manually by setting the "branch" to
refs/pull/{prId}/mergewhere{prId}is the ID of the PR.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.