Commit 88a6bed
`inferCubeFromQuery` guarded its `where` arm with `!Array.isArray(query.where)`,
written when an array `where` was not a filter. #5334 made it one, so one filter
minted two different cubes depending on its spelling:
where: {stage: 'won'} -> dimensions: {stage}
where: [['stage','=','won']] -> dimensions: {}
The `where` is now lowered to its canonical FilterCondition first, so the
spelling stops mattering. The lowering is #5334's own, extracted from
`normalizeAnalyticsFilterTree` as `lowerAnalyticsWhere` so exactly one of it
survives; keys are read via `conjunctFieldKeys`, which descends `$and` because
the lowering introduces `$and` where the object spelling has none. `$or` /
`$not` contribute no key on either spelling, as before.
No compiled statement, bound value or gate verdict changes: both spellings
already compiled a byte-identical predicate, and an inferred cube declares no
`joins`, so `qualifyAndRegisterJoin` leaves the newly-declared members' columns
bare. The rejection suggestion lists and `getMeta` now read alike for both.
A DOTTED `where` key stays spelling-dependent, deliberately: unifying it means
either propagating #5739's base-column mis-cast to the array spelling (measured:
a working traversal becomes a different-rows base-column filter, or a 400) or
splitting a verdict #5740 shares with the `dimensions` request key. Left to
#5739 and pinned by tests.
Claude-Session: https://claude.ai/code/session_01BWS4heBoAitLmzCLhcYdbK
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9f747ee commit 88a6bed
4 files changed
Lines changed: 667 additions & 57 deletions
File tree
- .changeset
- packages/services/service-analytics/src
- __tests__
- strategies
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
0 commit comments