CheckDefinition#
- class nominal.experimental.compute_as_code.CheckDefinition(title: str, expression: str, *, priority: Priority, description: str = '', key: str | None = None, event_type: EventType | None = None, event_labels: Sequence[str] | None = None)#
Bases:
objectA reusable failure condition written in the frontend compute language.
Bind channels when adding this definition to a
ChecklistBuilder. Usedataclasses.replaceor ordinary Python functions to create variations.- Parameters:
title – Display name of the check.
expression – Source ending in a range expression describing violations. Assignments are allowed; omit imports. Convert boolean conditions with
.ranges().priority – Severity of violations, from P0 (most severe) to P4.
event_type – Category of generated events. When omitted, the service uses
EventType.ERROR. This does not change the condition or turn absence of matching ranges into success.EventType.UNKNOWNis not a valid category for creation.event_labels – Labels applied to generated events, not checklist grouping labels. When omitted or empty, this check supplies no event labels. Labels are copied when the definition is added to a builder.
description – Description of the check.
key – Optional stable identity, independent of title and source. The same key preserves lineage across revisions. Omit to generate an identity each time the check is added. Keys are case-sensitive, are not trimmed, and must not be blank or repeated in a builder.