Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the filter parsing logic to treat empty arrays in _in and _nin operators as valid values rather than throwing an exception. The change allows empty arrays to function as intended: _in with an empty array matches no items (always false), and _nin with an empty array matches all items (always true).
- Removes the exception thrown when arrays are empty for
_inand_ninoperators - Updates tests to verify the new behavior instead of expecting exceptions
- Adds comprehensive test coverage for both empty
_inand_ninscenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/BccCode.Linq/Server/Filter.cs | Modified array validation to allow empty arrays and added null safety check for tuple creation |
| tests/BccCode.Linq.Tests/FilterTests.cs | Updated test to verify empty arrays are now allowed instead of throwing exceptions |
| tests/BccCode.Linq.Tests/Server/FilterToLambdaParserTests.cs | Added new tests for _in, empty _in, and empty _nin operator behaviors |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@u12206050 Great catch! I think this should be implemented, giving the library more optimistic behavior. @rvanoord pls review |
rvanoord
approved these changes
Aug 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Don't throw error if filter contains empty array on _in and _nin operators. Simply treat them as arrays that don't contain any values ie. false.