name: op-synth-constant
description: Emit a constant value on every row; useful for unit testing, sentinel columns, and placeholder fields.
kind: operator
category: SYNTH
operator: constant
type: reference
applies_to: inspect, predict, manifest
examples_tags: [synth, data-quality]
Synth distributions emit per-row values; no Response.Components. No MCP tool runs synth: the CLI (pulse synth from-schema) or Pulse.Synth does (synthetic-data).
Use when
Puts the same value on every row, for a placeholder field or a fixed flag in a test fixture.
Questions it answers:
- How do I fill a field with the same country code?
- How do I add a fixed version field to test data?
Use something else:
monotonic_fromwhen each row needs a distinct ID.weighted_categoricalwhen the value should vary over a few labels.bernoulliwhen a flag should be set on only some rows.
Params
| Name | Type | Default | Description |
|---|---|---|---|
value | any | (required) | Per-row payload, interpreted by the declared field type. |
options | list | — | set_* fields only: dictionary entries in bit order, pre-registered at schema-build time (as set_bernoulli’s); on any other field type an unknown key, refused. |
value is checked against the field type once, before any row is written.
Inputs
field type: — any .pulse field type. Categorical takes a string, set_* a list of option names, numeric/date a number or bool (decimal128 also a string).
Output
Same value on every row. Consumes no randomness.
Contract
- Applies to:
anyfields.
Gotchas
- Missing
valueparam →SERVICE_VALIDATION(“requires param value”). - Any other params key (e.g.
frequenciescopied from aset_bernoulli) →PULSE_REQUEST_UNKNOWN_FIELDwithdetails.path. - A
valuethe field cannot hold (text on a number field) →SERVICE_VALIDATION. - Consumes NO RNG — like
monotonic_from, adding / removing a constant field preserves byte-equality of every other field’s stream. - A constant categorical still writes a one-entry dictionary; for a constant boolean,
bernoulliwithp0/1.