Skip to content

A draft-preview dataset response skips the whole ADR-0021 result-column enrichment — no label, no format, no currency, no percentScale #16097

Description

@os-warren

Filed unassigned by the os-dev seat working #15768 (session https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y). Not graded, no domain:* — routing and priority are the triage seat's. Found while locating the result-field assembly point for that card; deliberately not absorbed into its PR.

What the code does

AnalyticsService.queryDataset (packages/services/service-analytics/src/analytics-service.ts) has an ADR-0037 P3 draft-preview branch. When the request renders the as-if-published world and the base object has a pending seed draft, the selection is evaluated over the seed rows in memory and the result is returned immediately:

const previewResult = await new DatasetExecutor(previewService).execute(compiled, selection, context);
// Label resolution is skipped on purpose: drafted seed rows reference
// lookups by NAME (the seed convention), which already reads well.
return previewResult;

That return is at roughly line 1115. The ADR-0021 result-column enrichment — the block that resolves a measure column's label, format, currency, percentScale and builtinAggregate from the authored measure plus sourceFieldMeta — starts at roughly line 1367, and the dimension-label enrichment sits just after it. So a preview response never reaches either.

Why the standing comment does not cover it

The comment justifies skipping dimension VALUE label resolution — resolving a lookup id to a display name — and its reasoning is sound: drafted seed rows reference lookups by name already. It says nothing about measure COLUMN metadata, which is a different question with a different answer: a measure's label / format / currency / percentScale come from the dataset's own authored measure definition, not from the rows, so nothing about seed rows makes them unnecessary or unavailable.

The consequence

The same dataset, rendered through the same widget, describes its columns differently depending on whether a pending seed draft exists:

live path draft-preview path
fields[].label the measure's authored label absent
fields[].format the measure's format absent
fields[].currency ADR-0053 chain resolved absent
fields[].percentScale resolved from metadata absent
fields[].builtinAggregate present per #14492 absent

A renderer then falls back to humanizing the raw measure name and to guessing a percent scale from magnitude — the exact failures #5537, objectui#3136 and #14492 each closed on the live path. Preview is the surface an author is looking at while authoring the dataset, which is when column metadata matters most.

Not in scope of #15768, and stated there

The services half of #15768 corrects fields[].type for a min/max over a temporal field, and it makes that correction inside this same enrichment block. So the preview path does not receive the type correction either — consistent with it receiving none of the other five. The PR for #15768 states this boundary rather than widening itself to cover it; whether preview should be enriched at all is a decision about that path, not a rider on a type fix.

Related

#15768 (where this was found) · #5537 (dimension descriptors on the filtered path) · #14492 (builtinAggregate) · objectui#3136 (percent scale).

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions