fix: support escaped fields in point selections - #9904
Merged
Conversation
vs-li
marked this pull request as ready for review
July 29, 2026 23:22
Contributor
Author
|
@domoritz This PR is ready for review as well! Was doing some self-highlight using selection and noticed a bug with escaped fields, so created this. |
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.
PR Description
Summary
Use
flatAccessWithDatumwhen extracting point-selection values."field": "y\\[foo\\]") now accessdatum["y[foo]"].Motivation
Point selections manually generated datum access with
stringValue, which quoted escaped field paths without interpreting them:Other Vega-Lite compiler paths use shared field-access helpers that correctly generate:
This caused point-selection behavior to differ from rendering, transforms, predicates, and other generated expressions.
As a result, point selections did not work as expected for marks using escaped field names.
History!
In 2019, #5351 changed selection field access to manual bracket lookup to support flattened fields such as
nested.a. This fixed nested selections but bypassed the shared helper that interprets escaped field names.Escaped bracket support was later added in #5730, but point selections did not inherit the fix when selection types were consolidated in #6927.
Checklist
npm testruns successfullysite/docs/+ examples.Tips: