Commit b9a0854
committed
feat(cql2-json): support CQL2 spec function format in parser and encoder
Add support for the standard CQL2-JSON function call format where functions
are expressed as {"op": "func_name", "args": [...]} at the top level,
in addition to the existing {"function": {"name": ..., "arguments": [...]}}
backward-compatible format.
Changes:
- parser.py: add else branch after BINARY_OP_PREDICATES_MAP check to treat
unknown ops as Function nodes instead of raising ValueError
- evaluate.py: simplify Function handler to always emit {"op": name, "args": [...]}
(spec-compliant format), removing non-standard lower/upper/function variants
- test_parser.py: add three new tests covering spec-format parsing, old-format
backward compatibility, and spec-format encoding1 parent f799198 commit b9a0854
3 files changed
Lines changed: 30 additions & 8 deletions
File tree
- pygeofilter
- backends/cql2_json
- parsers/cql2_json
- tests/parsers/cql2_json
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 85 | + | |
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
0 commit comments