-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
linkml-map's eval_utils.py is a fork of linkml_runtime.utils.eval_utils with some improvements (fixed None handling bug, added eval_expr_with_mapping()), but the expression evaluator is still missing basic operators that users would reasonably expect.
The long-term goal (per #98) is to unify the expression language across the LinkML ecosystem. Before upstreaming anything, we should make the evaluator here actually good and well-tested.
Missing operators and features
The safe evaluator currently lacks:
!=(not equal) — despite==being supportedand,or(logical operators viaast.BoolOp)not(logical negation viaast.UnaryOp/ast.Not)in,not in(membership testing)%(modulo)//(floor division)
Other improvements
- Remove dead Python 3.7 compat branches (
ast.Num,ast.Str,ast.NameConstant,ast.Index) — the project requires 3.9+ - Add comprehensive tests for all operators and edge cases
- Document what the expression language supports
Out of scope (for now)
- List comprehensions, multi-statement blocks, assignment — these require
unrestricted_eval=Trueand the asteval fallback. That's a separate concern. - Upstreaming to linkml/linkml — do this once the evaluator is solid.
Related
Sub-issue of #98
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request