monitor_schema.models.column_schema#

Schema definitions.

Attributes#

Classes#

Metadata

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

NoExtrasBaseModel

No extras base model.

Segment

A segment is a list of tags.

ColumnDiscreteness

Classifying the type.

ColumnDataType

Options for configuring data type for a column.

ColumnSchema

Schema configuration for a column.

WeightConfig

Object that specifies column weights.

SegmentWeightConfig

Object that specifies column weights for a segment.

EntitySchema

Schema definition of an entity.

EntityWeights

Entity weight configurations.

Module Contents#

class monitor_schema.models.column_schema.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.column_schema.NoExtrasBaseModel[source]#

Bases: pydantic.BaseModel

No extras base model.

Inherit to prevent accidental extra fields.

class monitor_schema.models.column_schema.Segment[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

A segment is a list of tags.

We normalize these in the backend.

tags: List[SegmentTag]#
monitor_schema.models.column_schema.COLUMN_NAME_TYPE#
class monitor_schema.models.column_schema.ColumnDiscreteness[source]#

Bases: str, enum.Enum

Classifying the type.

discrete = 'discrete'#
continuous = 'continuous'#
class monitor_schema.models.column_schema.ColumnDataType[source]#

Bases: str, enum.Enum

Options for configuring data type for a column.

integral = 'integral'#
fractional = 'fractional'#
boolean = 'bool'#
string = 'string'#
unknown = 'unknown'#
null = 'null'#
class monitor_schema.models.column_schema.ColumnSchema[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Schema configuration for a column.

Should be generated by WhyLabs originally but can be overridden by users.

discreteness: ColumnDiscreteness#
dataType: ColumnDataType#
classifier: str | None#
class monitor_schema.models.column_schema.WeightConfig[source]#

Bases: monitor_schema.models.commons.NoExtrasBaseModel

Object that specifies column weights.

  • By default, the weight of a column is None (unspecified)

  • If the weight is unspecified, the column is EXCLUDED when you perform a filter/sort by weight

  • For sorting, unweighted column take the LEAST PRECEDENCE, meaning that weight column have higher priorities

  • They are not hierarchical: if a segment weight config is specified and a column does not have a weight in that

config, we will not use any hierarchy to resolve the value. It will be None - Order of unweighted column is undefined.

weights: Dict[monitor_schema.models.utils.COLUMN_NAME_TYPE, float]#
class monitor_schema.models.column_schema.SegmentWeightConfig[source]#

Bases: WeightConfig

Object that specifies column weights for a segment.

segment: monitor_schema.models.segments.Segment | None#
class monitor_schema.models.column_schema.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.column_schema.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#