tonghzhang opened a new pull request, #939:
URL: https://github.com/apache/burr/pull/939
`Condition.safe_expr("bool({**{}})")` currently returns true: dictionary
unpacking passes validation, but the interpreter treats its AST sentinel as a
literal `None` key. Similarly, a membership condition such as `'allowed' in
{**mapping}` silently returns false even when `mapping` contains that key.
## Changes
Reject unsupported dictionary unpacking when constructing the condition,
matching the existing rejection of other unpacking forms. Document the
restriction and cover plain, mixed, repeated, nested, and short-circuited
unpacking, plus a valid literal `None` key.
## How I tested this
- The five new rejection cases fail on the original implementation and pass
after the fix.
- `python -m pytest tests/core/test_action.py -q`: 160 passed.
- Broader `tests/core` run: 402 passed; four existing graph-rendering tests
failed because the local Windows environment has no Graphviz `dot` executable.
- Repository pre-commit hooks passed for both changed files (the
frontend-only hook was skipped), including Black, isort, flake8, Python AST,
whitespace, and ASF headers. `git diff --check` also passed.
## Notes
Prepared with OpenAI Codex assistance; the regression and broader test
results above were run locally. The commit includes a `Generated-by` trailer.
## Checklist
- [x] PR has an informative and human-readable title
- [x] Changes are limited to a single goal
- [x] Any change in functionality is tested
- [x] The public API docstring describes the restriction
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]