Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: tool-materialize
kind: tool
description: Write a request's derived outputs (features, attributes, windows) as ordinary fields of a new cohort that later requests read.
type: reference
applies_to: mcp

When to use

CALL WHEN A LATER REQUEST MUST READ A WINDOW, FEATURE OR ATTRIBUTE OUTPUT AS AN ORDINARY FIELD. A derived value lives only inside the request that computes it: a later request cannot name it, nor a filter read an attribute or window. pulse_materialize writes it to a new cohort; point the next request at out.

Input

  • request (object, required): a request body (the pulse_process shape) with cohort. Only cohort, label, features, filterers, attributes, windows, sort, weight, time_zone, disable_components, params, models (loaded fits for coef() / sweep_axis()), output.
  • out (string; required unless predict): the NEW .pulse path, relative to the data directory.
  • overwrite (bool): replace an existing cohort at out.
  • predict (bool): validate only; writes nothing.

Output

No envelope: target, records (one per filter-passing source record; source order, or sort order), derived_columns (output order: feature outputs, attributes, windows), warnings, invalidated_sidecars (overwrite only, each with its rebuild command).

predict: true answers under predict: valid, columns, derived_columns, risks, errors / warnings (the run’s codes).

The cohort holds the source fields verbatim, then one nullable f64 per derived field (an ATTR_PREVIOUS_STATE output keeps its state field’s categorical type and dictionary), described by operator, field, params and (when read) frame.

Gotchas

  • Nest the request. A slot beside out → PULSE_REQUEST_UNKNOWN_FIELD; a slot outside the list → PULSE_MATERIALIZE_SLOT_UNSUPPORTED (details.slot); nothing derived → PULSE_MATERIALIZE_NO_DERIVED.
  • Label outputs you will reference: the written field is named by the label.
  • Integer window outputs are f64; a non-numeric one → PULSE_MATERIALIZE_OUTPUT_NOT_NUMERIC.
  • Existing out without overwrite → SERVICE_VALIDATION. Refusals precede any write (atomic).
  • sort orders ROWS only (source or derived keys, nulls last); windows follow their own order_by.
  • Only the SPSS metadata sidecar is carried.
  • output picks, orders, renames, describes, recodes, buckets, retypes columns; applied last (derived-cohorts, materialize-recode, materialize-casts); shards / groups shape the file (materialize-container).

See