name: op-attr-set-has
description: Per-row 0/1 — whether the configured label's bit is set on a set field.
kind: operator
category: ATTR
operator: ATTR_SET_HAS
type: reference
applies_to: process, compose, predict
examples_tags: [feature-engineering, streaming-friendly]
Use when
Adds a 1 / 0 field saying whether each row’s multi-select field includes one named option.
Questions it answers:
- Which respondents ticked ‘price’ among their reasons, as a field to cross with other answers?
- Which tickets carry the ‘urgent’ tag?
Use something else:
FILTER_SET_CONTAINS_ANYwhen you want to keep only rows that include any of several options.
Params
Wire: label is a top-level attribute key (beside field), not under params.
| Name | Type | Default | Description |
|---|---|---|---|
label | string | (required) | Dictionary label whose bit position is checked per row. Resolved against the set field’s inline dictionary at schema time. |
Inputs
field — admitted types: see ## Contract.
label(slot) — derived field name, defaultATTR_SET_HAS_<field>;params.labelis the dictionary label
Output
One packed_bool per record — 1 if the named label’s bit is set, 0 otherwise. Null source → 0 (not null): a membership flag, so its mean is the share of the whole base.
Contract
- Types (
field):set_*; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: not read; a weight in force is skipped.
- Streaming: streamable.
Gotchas
- Row-local one-pass — streams cleanly; merges (shards, parallel decode, chain stages).
params.labelnot in the field’s dictionary →PROCESSING_CONFIGat run time; predict passes it.- Frequently fanned out — one slot per label of interest — to build per-label binary cohorts. Multi-label tests are cheaper as one set filter or one
ATTR_FORMULAusinghas_any/has_all. - Coerces to
f64(1.0 / 0.0) when read by downstream numeric ops.
See
pulse_examples_search tags=[feature-engineering]- Skills:
attribute-composition,cohort-schema-design,op-attr-set-popcount