Repository navigation
fix(filter): let a padded raw string match a value with edge quotes - #214
Merged
Merged
Conversation
A value that starts or ends with a double quote cannot be matched today, because the opening run of quotes swallows a leading quote and a trailing quote runs into the closing delimiter. These tests pin the padding rule that fixes it: one space is dropped from each end of a raw string value when both ends have a space and the value is not only spaces. They also pin that a raw quoted list for the in operator still drops item quotes.
A raw string value could not start or end with a double quote. The opening run of quotes took a leading quote as part of the delimiter, and a trailing quote ran into the closing delimiter. Now one space is dropped from each end of a raw string value when both ends have a space and the value is not only spaces, so """ "hi" """ is the value "hi". The scalar string path and the bracket list path also stripped every edge quote from the value after the parser had already removed the delimiters, which undid the padding. The scalar trim is removed. The list trim now applies only to a quoted list for the in operator, which still needs it to unwrap its items. This changes """ x """ from " x " to "x".
Owner
Author
|
Shipping verdict: PASS+NOTES from an independent verifier agent that did not write the code. It used the verify-querykit harness on base 63e10e4 and head c4795a8, in memory and on Postgres. Memory and Postgres agreed on every case. The commit after c4795a8 (aa7b7b0) changes only README.md, so the verdict covers the current code. Note: a raw list item now keeps its edge quotes ( |
pdevito3
added a commit
that referenced
this pull request
Nov 1, 2026
…214) * test(filter): pin the space padding rule for raw string values A value that starts or ends with a double quote cannot be matched today, because the opening run of quotes swallows a leading quote and a trailing quote runs into the closing delimiter. These tests pin the padding rule that fixes it: one space is dropped from each end of a raw string value when both ends have a space and the value is not only spaces. They also pin that a raw quoted list for the in operator still drops item quotes. * fix(filter): let a padded raw string match a value with edge quotes A raw string value could not start or end with a double quote. The opening run of quotes took a leading quote as part of the delimiter, and a trailing quote ran into the closing delimiter. Now one space is dropped from each end of a raw string value when both ends have a space and the value is not only spaces, so """ "hi" """ is the value "hi". The scalar string path and the bracket list path also stripped every edge quote from the value after the parser had already removed the delimiters, which undid the padding. The scalar trim is removed. The list trim now applies only to a quoted list for the in operator, which still needs it to unwrap its items. This changes """ x """ from " x " to "x". * docs(readme): remove the em dash from the per-property override note * docs(readme): describe how a list item trims whitespace and keeps edge quotes
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.
Why
A filter value that starts or ends with
"had no form that worked, on any operator. The opening run of quotes in a raw string is the delimiter, so an edge quote became part of the delimiter. Now, if a raw string starts and ends with a space, QueryKit removes one space from each end. Markdown code spans use the same rule. ThusTitle == """ "hi" """comparesTitlewith"hi".What changed
RawStringLiteralParserremoves one space from each end when both ends have a space and the value is not all spaces.Trim('"')calls inCreateRightExprFromTypestripped the quotes again after the parser. The scalar trim is deleted, because no parser can give an edge quote except through the new rule. The list-item trim now runs only for a quoted list such as"""["a", "b"]""".""""hi""""case, and the behavior change.Scope
"..."strings do not get the rule.""""hi""""still giveshiwith no error. The README now explains it.Tradeoffs
\in it, for example a Windows path."") conflict with the grammar, because"""already opens a raw string.Blast Radius
A raw string that starts and ends with a space now loses one space at each end. A raw list item now keeps its edge quotes. Both are intended, and the release notes for v1.17.1 call them out.
Verification
Title == """ "hi" """sends= ' "hi" 'on base and= '"hi"'on head. The verdict was PASS+NOTES.QueryKit.UnitTestspasses 868 of 868, andQueryKit.IntegrationTestspasses 394 of 394. The new tests failed on the base parser.