Skip to content

Commit c59cf00

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 e36a61c commit c59cf00

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
@@ -412,8 +412,14 @@ def _apply_filter(value: Any, filter_expr: str, namespace: dict[str, Any]) -> An
412412
# Use ``_find_top_level``, the same scanner the operator splitting uses: it
413413
# skips commas inside quotes AND inside nested brackets, so a single
414414
# argument that happens to contain a comma still works -- ``join(", ")``,
415-
# ``default("a, b")``, and the list/dict literals the evaluator supports
416-
# (``default([1, 2])``, ``default({"a": 1, "b": 2})``).
415+
# ``default("a, b")``, and the list literals the evaluator supports
416+
# (``default([1, 2])``).
417+
#
418+
# List literals are the only container form ``_evaluate_simple_expression``
419+
# implements; a mapping such as ``{"a": 1}`` has no branch there and falls
420+
# through to dot-path resolution, which yields ``None``. The scanner does
421+
# skip commas inside braces too, so nothing here changes if that ever gains
422+
# support -- but do not read this comment as a promise that it exists.
417423
if filter_match and _find_top_level(filter_match.group(2), ",") != -1:
418424
filter_match = None
419425
if filter_match:

0 commit comments

Comments
 (0)