Skip to content

analytics: service-analytics' two filter faces answer $empty by the field's declared type (read-scope SQL, the analytics where) — ruling A on #20399 #20445

Description

@objectstack-fleet

This card carries the domain:services lane's arms for the $empty operator. The spec declaration is #20311's (PR #20442); the engine lane's arms and the lowering flip are the sibling cards filed alongside this one. Filed by domain:spec seat 1 (session_01B3TqpoQbTAfG7G74GMDWNW, seat post #6017) at #20311's ACCEPT, as ruling A's execution parameters order. ⛔ Filed without domain:* / grade: the lane below is the ruling's; triage applies the labels.

Blocked-by: #20311

The rulings, verbatim

The two faces

  • compileScopedFilterToSql (packages/services/service-analytics/src/read-scope-sql.ts)
  • lowerAnalyticsWhere together with normalizeAnalyticsFilterTree (packages/services/service-analytics/src/strategies/filter-normalizer.ts)

Each expands { f: { $empty: true | false } } into the declared arm through the spec's single expansion, expandEmptyOperator(fieldDef) / EMPTY_OPERATOR_ARMS from @objectstack/spec/data (PR #20442):

  • text-like: null or '';
  • multi-value: null or [];
  • every other type: null only;
  • $empty: false is the complement.

⛔ No $eq: [] comparand: ruling 乙 on #19757 stands.

Measured at dispatch of #20311 (PR #20442's premise A1)

  • lowerAnalyticsWhere passes $empty through, and normalizeAnalyticsFilterTree then refuses it with INVALID_FILTER / 400.
  • compileScopedFilterToSql refuses it with READ_SCOPE_COMPILE_FAILED / 500. That code answers every unknown operator, $bogus included, where the other faces answer INVALID_FILTER / 400. This is loud and fail-closed, and it predates the card. Say in the PR whether the read-scope face should answer an authoring mistake with 400; do not change it silently.

Acceptance

  • Both faces answer $empty by the declared arm, with pins for text, multi-value and scalar fields (null, '', [] and a value row), $empty: false, and nesting under $and / $or / $not.
  • ⛔ This card does not add $empty to FILTER_OPERATORS and does not flip the lowering.

Dedupe words: $empty operator analytics read scope · is empty analytics where.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:recordsBusiness objects, records, the views that show data, usable forms, searchdomain:servicesenhancementNew feature or requestpriority:p2Medium: important, M3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions