fix(language): a where string names several columns in at's over= and into=, as an expression does - #782
Merged
Conversation
… into=, as an expression does The where grammar read one name or arithmetic after a kwarg's `=`, so `at(p, by=r, over=a, into=[b, c])` failed to parse in a where string while the expression grammar took the list. The bracketed name list is now one grammar element both parsers use. Closes #781. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
FBumann
pushed a commit
that referenced
this pull request
Sep 29, 2026
Takes #782, which lets a where string name several columns in at's over= and into=. CHANGELOG keeps both lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
FBumann
pushed a commit
that referenced
this pull request
Sep 29, 2026
fluxopt's investment cost curve reads each effect of a sized flow off its curve, so its mask reaches the cost row as at(…, into=[flow, effect]). Without #782 the load fails on the assertion that what a method assumes is stated in the language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
FBumann
pushed a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzXL2w5xdUm8FsYMNWf1KW
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.
Note
The following content was generated by AI.
A
where:string now acceptsat(p, by=r, over=a, into=[b, c])and a list inover=, as an expression already did. Before, it failed to parse. The bracketed name list is now one grammar element that both parsers use.Closes #781.
What this changes
_expression_parser.NAME_LISTis the bracketed name list, moved to module level. The expression grammar and the where grammar both read a kwarg value as a quoted keyword, a name list, or arithmetic.relation_ref, so nothing changes there. The read is held to the same rules asatin an expression.expressions.mdsays thatover=andinto=each name one column or a list, in awhere:too.Why
A piecewise block in #630 with a
where:and a link that walksinto: [flow, effect]writes thiswhere:into its rows and assumptions. That load failed withSchemaError: Assertion failed, what a method assumes is stated in the language. fluxopt's investment cost curve (fluxopt/fluxopt#26) has that shape.Test, gates, and what was not run
Test.
TestAPredicateIsAnOperand::test_a_read_names_several_columns_as_an_expression_does, parametrized byinto-names-several-columnsandover-names-several-columns. Each case loads a constraint with the list, checks the mask's dims and what it reads, checks thatto_yaml()loads again to the same program, and checks that markdown, LaTeX and Typst print the operand and the relation.Without the fix (the
src/change stashed), both cases fail:Gates run in a uv venv (Python 3.12) with the pinned tool versions, since pixi cannot be installed here:
pytest -q -n autoruff check,ruff format --check(0.16.1)pyrefly check(1.2.0)prettier --checkonexpressions.md,typosdocs-build,compile-texdocs.python.org, and there is no tectonicNot done: #630 is not changed here. Once this merges, #630 takes
mainand adds its block withwhere:andinto: [flow, effect]as a regression test.🤖 Generated with Claude Code
https://claude.ai/code/session_015VUkQfE5dT7mEGoTQXSxN3
Generated by Claude Code