Skip to content

fix(cql2-json): CQL2 Advanced Comparison conformance fixes#154

Open
constantinius wants to merge 1 commit into
mainfrom
cql2-advanced-comparison-compliance
Open

fix(cql2-json): CQL2 Advanced Comparison conformance fixes#154
constantinius wants to merge 1 commit into
mainfrom
cql2-advanced-comparison-compliance

Conversation

@constantinius

Copy link
Copy Markdown
Contributor

Align the CQL2 Advanced Comparison conformance class with the OGC 21-065r2 spec.

Changes

  • BETWEEN: Use 3 flat args [lhs, low, high] per spec, not nested [lhs, [low, high]] (both parser and encoder)
  • NOT flags: Encoder now wraps LIKE, BETWEEN, IN in {"op": "not", ...} when not_=True (was silently dropped)
  • CASEI: Parser accepts {"op": "casei", ...} per spec (and legacy {"lower": ...}). Encoder outputs {"op": "casei", ...}
  • ACCENTI: Parser accepts {"op": "accenti", ...}. Encoder outputs {"op": "accenti", ...}

Spec reference

OGC 21-065r2 §6.7

- BETWEEN: switch to flat 3-arg format [lhs, low, high] in both parser and
  encoder, matching OGC CQL2 spec (previously used nested [lhs, [low, high]])
- NOT flags: wrap like/between/in_ results in {"op": "not", "args": [...]}
  when node.not_ is True, matching behavior of isNull handler
- CASEI/ACCENTI: parse 'casei'/'lower' op to ast.Function('lower', ...),
  'accenti' op to ast.Function('accenti', ...); encode lower->casei and
  accenti->accenti using {"op": ...} format instead of non-standard
  {"lower": ...}/{"upper": ...} objects
- Fix function fallback encoder to use {"op": name, "args": [...]} format
- Update test fixtures and add conformance regression tests for round-trips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant