monitor_schema.models.document#

The overall document for monitor.

Attributes#

Classes#

NoExtrasBaseModel

No extras base model.

Analyzer

Configuration for running an analysis.

EntitySchema

Schema definition of an entity.

EntityWeights

Entity weight configurations.

Metadata

Metadata for a top-level objects such as monitors, analyzers, and schema.

Monitor

Customer specified monitor configs.

Granularity

Supported granularity.

Document

The main document that dictates how the monitor should be run. This document is managed by WhyLabs internally.

Module Contents#

class monitor_schema.models.document.NoExtrasBaseModel[source]#

Bases: pydantic.BaseModel

No extras base model.

Inherit to prevent accidental extra fields.

class monitor_schema.models.document.Analyzer[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Configuration for running an analysis.

An analysis targets a metric (note that a metric could be a complex object) for one or multiple fields in one or multiple segments. The output is a list of ‘anomalies’ that might show issues with data.

metadata: monitor_schema.models.commons.Metadata | None#
id: str#
displayName: str | None#
tags: Optional[List[constr(min_length=3, max_length=256, regex='[0-9a-zA-Z\\-_]')]]#
targetSize: int | None#
schedule: monitor_schema.models.commons.CronSchedule | monitor_schema.models.commons.FixedCadenceSchedule | None#
disabled: bool | None#
disableTargetRollup: bool | None#
targetMatrix: monitor_schema.models.analyzer.targets.ColumnMatrix | monitor_schema.models.analyzer.targets.DatasetMatrix | None#
dataReadinessDuration: str | None#
batchCoolDownPeriod: str | None#
backfillGracePeriodDuration: str | None#
config: monitor_schema.models.analyzer.algorithms.ConjunctionConfig | monitor_schema.models.analyzer.algorithms.DisjunctionConfig | monitor_schema.models.analyzer.algorithms.DiffConfig | monitor_schema.models.analyzer.algorithms.ComparisonConfig | monitor_schema.models.analyzer.algorithms.ListComparisonConfig | monitor_schema.models.analyzer.algorithms.FrequentStringComparisonConfig | monitor_schema.models.analyzer.algorithms.ColumnListChangeConfig | monitor_schema.models.analyzer.algorithms.FixedThresholdsConfig | monitor_schema.models.analyzer.algorithms.StddevConfig | monitor_schema.models.analyzer.algorithms.DriftConfig | monitor_schema.models.analyzer.algorithms.ExperimentalConfig | monitor_schema.models.analyzer.algorithms.SeasonalConfig#
class Config[source]#

Updates JSON schema anyOf to oneOf.

static schema_extra(schema: Dict[str, Any], model: pydantic.BaseModel) None[source]#

Update specific fields here (for Union type, specifically).

class monitor_schema.models.document.EntitySchema[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Schema definition of an entity.

metadata: monitor_schema.models.commons.Metadata | None#
columns: Dict[monitor_schema.models.utils.COLUMN_NAME_TYPE, ColumnSchema]#
class monitor_schema.models.document.EntityWeights[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Entity weight configurations.

metadata: monitor_schema.models.commons.Metadata | None#
defaultWeights: WeightConfig | None#
segmentWeights: List[SegmentWeightConfig] | None#
monitor_schema.models.document.DATASET_ID_DEF#
class monitor_schema.models.document.Metadata[source]#

Bases: NoExtrasBaseModel

Metadata for a top-level objects such as monitors, analyzers, and schema.

This object is managed by WhyLabs. Any user-provided values will be ignored on WhyLabs side.

version: int#
schemaVersion: int | None#
updatedTimestamp: int#
author: str#
description: str | None#
class monitor_schema.models.document.Monitor[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Customer specified monitor configs.

metadata: monitor_schema.models.commons.Metadata | None#
id: str#
displayName: str | None#
tags: Optional[List[constr(min_length=3, max_length=256, regex='[0-9a-zA-Z\\-_]')]]#
analyzerIds: List[constr(regex='^[A-Za-z0-9_\\-]+$')]#
schedule: monitor_schema.models.commons.FixedCadenceSchedule | monitor_schema.models.commons.CronSchedule | monitor_schema.models.commons.ImmediateSchedule#
disabled: bool | None#
severity: int | None#
mode: EveryAnomalyMode | DigestMode#
actions: List[GlobalAction | SendEmail | SlackWebhook | RawWebhook]#
class Config[source]#

Updates JSON schema anyOf to oneOf.

static schema_extra(schema: Dict[str, Any], model: pydantic.BaseModel) None[source]#

Update specific fields here (for Union type, specifically).

class monitor_schema.models.document.Granularity[source]#

Bases: str, enum.Enum

Supported granularity.

hourly = 'hourly'#
daily = 'daily'#
weekly = 'weekly'#
monthly = 'monthly'#
class monitor_schema.models.document.Document[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

The main document that dictates how the monitor should be run. This document is managed by WhyLabs internally.

id: uuid.UUID | None#
schemaVersion: Literal[1]#
metadata: monitor_schema.models.commons.Metadata | None#
orgId: str#
datasetId: str#
granularity: Granularity#
allowPartialTargetBatches: bool | None#
entitySchema: monitor_schema.models.column_schema.EntitySchema | None#
weightConfig: monitor_schema.models.column_schema.EntityWeights | None#
analyzers: List[monitor_schema.models.analyzer.Analyzer]#
monitors: List[monitor_schema.models.monitor.Monitor]#