Skip to content

fix(cql2): CQL2 Core conformance fixes#153

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

fix(cql2): CQL2 Core conformance fixes#153
constantinius wants to merge 1 commit into
mainfrom
cql2-core-compliance

Conversation

@constantinius

Copy link
Copy Markdown
Contributor

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

Changes

  • Property names: Allow single-character identifiers (regex +*)
  • JSON encoder: Fix date/datetime serialization to use spec-required wrapper objects ({"date": "..."}, {"timestamp": "...Z"}) instead of bare strings. The existing @handle(datetime) was dead code (overridden by literal handler via metaclass ordering). Added proper handlers after literal so they take priority.
  • Timestamp format: Use Z suffix per spec, not +00:00
  • Debug cleanup: Remove leftover print() statements in wkt.py

Spec reference

OGC 21-065r2 §6.3.1

- Allow single-character property names in CQL2 Text grammar by
  changing the attribute regex from /[a-zA-Z][a-zA-Z_:0-9.]+/ to
  /[a-zA-Z][a-zA-Z_:0-9.]*/ (+ to *). The spec requires identifiers
  to be at least one character, not two.

- Fix CQL2 JSON encoder date/datetime serialization. The previous
  dead-code @handle(datetime) with wrong node annotation was
  overshadowed by the literal handler. Reorder handlers so date and
  datetime handlers come AFTER the generic literal handler so the
  metaclass registry correctly maps them. Date values are now
  serialized as {"date": "YYYY-MM-DD"} and datetime values as
  {"timestamp": "...Z"} with Z suffix instead of +00:00.

- Remove debug print() calls from wkt.py (geometry_with_srid and
  multipoint_2 handlers).

- Add regression tests: single-char attribute parsing, date/datetime
  round-trip through JSON parser and encoder.
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