Skip to content

Commit 5536c88

Browse files
jawwad-aliclaude
andcommitted
docs(workflows): drop the unsupported dict-literal example from the comment
Addresses review feedback: `_evaluate_simple_expression` implements a list literal branch only. A mapping such as `{"a": 1}` has no branch there and falls through to dot-path resolution: list literal [1, 2] -> [1, 2] dict literal {"a": 1} -> None So the comment's claim that the evaluator supports dict literals was wrong. Comment-only; no behaviour change. `_find_top_level` is brace-aware as well as bracket-aware (`_find_top_level('{"a": 1, "b": 2}', ',')` returns -1), so the scanner treats such a comma as nested either way -- the example was simply describing syntax the evaluator does not implement, which is exactly the kind of thing a future change might have relied on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 4b19ce0 commit 5536c88

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/specify_cli/workflows/expressions.py‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,14 @@ def _apply_filter(value: Any, filter_expr: str, namespace: dict[str, Any]) -> An
462462
# Use ``_find_top_level``, the same scanner the operator splitting uses: it
463463
# skips commas inside quotes AND inside nested brackets, so a single
464464
# argument that happens to contain a comma still works -- ``join(", ")``,
465-
# ``default("a, b")``, and the list/dict literals the evaluator supports
466-
# (``default([1, 2])``, ``default({"a": 1, "b": 2})``).
465+
# ``default("a, b")``, and the list literals the evaluator supports
466+
# (``default([1, 2])``).
467+
#
468+
# List literals are the only container form ``_evaluate_simple_expression``
469+
# implements; a mapping such as ``{"a": 1}`` has no branch there and falls
470+
# through to dot-path resolution, which yields ``None``. The scanner does
471+
# skip commas inside braces too, so nothing here changes if that ever gains
472+
# support -- but do not read this comment as a promise that it exists.
467473
if filter_match and _find_top_level(filter_match.group(2), ",") != -1:
468474
filter_match = None
469475
if filter_match:

0 commit comments

Comments
 (0)