fix(filters): relative dates in an analysis filter no longer answer HTTP 500 #44

Merged
james.maes merged 2 commits from fix/relative-date-filters into develop 2026-11-11 13:11:50 +00:00
Owner

What

An analysis whose filter holds a relative date (a filter expression: NowWithOffset, ThisOrLastPeriod, Now) on a date or date-time field answered HTTP 500, 'Unsupported class ...NowWithOffset for converting to Instant'. DrillFilters.restoreTypes converted every criterion value to the field's type before the query and did not expect an expression. Expressions are now passed through; core evaluates them when the query runs.

Why

GG Forge's assistant asks grouped questions through POST /qbit/data-analysis/tables/{table}/pivot ('how many documents were printed in the last day, by format'), and a saved, scheduled analysis must mean 'the last day' on every run. Found by the assistant's contract test against 0.1.0-RC.7.

Tests

  • New PivotContractTest.pivotWithRelativeDateFilter (memory, H2, H2 compatibility, H2 streamed, PostgreSQL): direct and after the JSON round trip, drills counted. It fails without the change (run: MemoryEngineTest and H2EngineTest, 1 error each, the message above).
  • ./mvnw -B verify locally: 323 tests, 0 failures, coverage checks met, BUILD SUCCESS.

🤖 Generated with Claude Code

## What An analysis whose filter holds a relative date (a filter expression: NowWithOffset, ThisOrLastPeriod, Now) on a date or date-time field answered HTTP 500, 'Unsupported class ...NowWithOffset for converting to Instant'. `DrillFilters.restoreTypes` converted every criterion value to the field's type before the query and did not expect an expression. Expressions are now passed through; core evaluates them when the query runs. ## Why GG Forge's assistant asks grouped questions through `POST /qbit/data-analysis/tables/{table}/pivot` ('how many documents were printed in the last day, by format'), and a saved, scheduled analysis must mean 'the last day' on every run. Found by the assistant's contract test against 0.1.0-RC.7. ## Tests - New `PivotContractTest.pivotWithRelativeDateFilter` (memory, H2, H2 compatibility, H2 streamed, PostgreSQL): direct and after the JSON round trip, drills counted. It fails without the change (run: MemoryEngineTest and H2EngineTest, 1 error each, the message above). - `./mvnw -B verify` locally: 323 tests, 0 failures, coverage checks met, BUILD SUCCESS. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
james.maes added 2 commits 2026-11-11 13:05:51 +00:00
fix(filters): relative dates in an analysis filter no longer answer HTTP 500
maven / build (push) Successful in 4m20s
build / maven (push) Successful in 4m20s
a707215317
A filter criterion whose value is a filter expression (NowWithOffset, ThisOrLastPeriod, Now)
on a date or date-time field failed in DrillFilters.restoreTypes with 'Unsupported class
...NowWithOffset for converting to Instant': the value was converted to the field's type
before the query. Expressions are now passed through for core to evaluate, so a pivot
'created in the last day' works directly, after the JSON round trip of the UI API and of a
saved definition, and its drill filters carry the expression.

PivotContractTest.pivotWithRelativeDateFilter fails without the change on the memory, H2
and PostgreSQL engines.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs(changelog): file the relative-date fix under Unreleased / Fixed
maven / build (push) Successful in 3m15s
build / maven (push) Successful in 3m15s
472fcbf8dd
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
james.maes merged commit ae57a9442b into develop 2026-11-11 13:11:50 +00:00
Sign in to join this conversation.