Conversation
InOperator(true) and NotInOperator(true) read the list from the NewArrayExpression that the parser makes. v1.14.2 also read a list that a caller passed as a ConstantExpression. Remove this second path. The operators read the list only from the parsed array. BREAKING CHANGE: a caller that passes a ConstantExpression list to InOperator(true) or NotInOperator(true) gets NullReferenceException. Pass the values as a NewArrayExpression of constants, or use a filter string.
pdevito3
force-pushed
the
fm/qk-breaking-in-constant-list
branch
from
October 1, 2026 21:48
3edbd86 to
42ca1cc
Compare
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.
For later consideration in a major version. Do not merge now. #134 restored the v1.14.2 list read to keep v1.x compatible (restore commit
e6d55b3). This PR re-applies the list read of5db8c4b(#110). The captain decides on this PR separately.Summary
The change is in the case-insensitive string path of
InTypeandNotInType, inQueryKit/Operators/ComparisonOperator.csonly.v1.14.2 behavior (and main)
InOperator(true)andNotInOperator(true)read the list from aNewArrayExpression(the shape that the parser makes) or from aConstantExpressionthat holds the list.New behavior
The case-insensitive path reads the list only from a
NewArrayExpression. With aConstantExpressionlist,originalListis null and the operator throwsNullReferenceException. The case-sensitive path does not change: it still accepts aConstantExpressionlist.Example
x => ((x.Title != null) AndAlso <list>.Contains(x.Title.ToLower())), with the list["lamb"].NullReferenceException.Filter strings (
Title ^^* ["LAMB"]) do not change, because the parser makes aNewArrayExpression.Justification
This change is a side effect of #110, which moved the in-list values to a parameter holder. The operator now builds the list from one input shape only. The justification for this PR alone is weak: the result for a
ConstantExpressionlist is aNullReferenceException, not a clear error. If a major version wants one input shape, a clear exception is better than this change. The captain can close this PR to keep the v1.14.2 behavior.Migration
If you call
InOperator(true)orNotInOperator(true)directly with aConstantExpressionlist, pass aNewArrayExpressionof constants (Expression.NewArrayInit(typeof(string), ...)) instead. Or use a filter string.README
No change. The README does not document the operator factories.
Tests
Unit
FilterParsingRegressionTests.case_insensitive_in_operator_factory_reads_a_constant_list(theory, In and NotIn) is removed. #134 added this test. Main before #134 had no test for this input, so no test comes back. No integration test changes.dotnet test: 468 unit tests and 297 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on main
This branch is rebased on current main (#169). The rebase had no conflicts. The breaking change did not change.