Data Quality Monitors¶
Package: databricks.bundles.data_quality_monitors
Classes¶
- class AggregationGranularity¶
The granularity for aggregating data into time windows based on their timestamp.
- AGGREGATION_GRANULARITY_5_MINUTES = 'AGGREGATION_GRANULARITY_5_MINUTES'¶
- AGGREGATION_GRANULARITY_30_MINUTES = 'AGGREGATION_GRANULARITY_30_MINUTES'¶
- AGGREGATION_GRANULARITY_1_HOUR = 'AGGREGATION_GRANULARITY_1_HOUR'¶
- AGGREGATION_GRANULARITY_1_DAY = 'AGGREGATION_GRANULARITY_1_DAY'¶
- AGGREGATION_GRANULARITY_1_WEEK = 'AGGREGATION_GRANULARITY_1_WEEK'¶
- AGGREGATION_GRANULARITY_2_WEEKS = 'AGGREGATION_GRANULARITY_2_WEEKS'¶
- AGGREGATION_GRANULARITY_3_WEEKS = 'AGGREGATION_GRANULARITY_3_WEEKS'¶
- AGGREGATION_GRANULARITY_4_WEEKS = 'AGGREGATION_GRANULARITY_4_WEEKS'¶
- AGGREGATION_GRANULARITY_1_MONTH = 'AGGREGATION_GRANULARITY_1_MONTH'¶
- AGGREGATION_GRANULARITY_1_YEAR = 'AGGREGATION_GRANULARITY_1_YEAR'¶
- class AnomalyDetectionConfig¶
Anomaly Detection Configurations.
- notification_settings: NotificationSettings | None = None¶
Who to alert when anomaly detection finds unhealthy tables in this schema. Applicable to schema monitors only. This is the same schema alert you manage from Manage alerts in the Data Quality Monitoring UI, so a change made in either place shows in both.
Set the recipients in on_unhealthy_table; on_failure is not supported here. Only destination_ids and destination_user_ids are supported.
On update, an update mask of *, anomaly_detection_config, or anomaly_detection_config.notification_settings replaces the alert’s recipients with the ones in the request; omitting the field, or leaving both recipient lists empty, removes the alert. Other masks leave the alert unchanged.
- class CronSchedule¶
The data quality monitoring workflow cron schedule.
- timezone_id: str¶
A Java timezone id. The schedule for a job will be resolved with respect to this timezone. See Java TimeZone for details. The timezone id (e.g.,
America/Los_Angeles) in which to evaluate the quartz expression.
- class DataProfilingConfig¶
Data Profiling Configurations.
- assets_dir: str | None = None¶
Field for specifying the absolute path to a custom directory to store data-monitoring assets. Normally prepopulated to a default user location via UI and Python APIs.
- baseline_table_name: str | None = None¶
Baseline table name. Baseline data is used to compute drift from the data in the monitored table_name. The baseline table and the monitored table shall have the same schema.
- custom_metrics: list[DataProfilingCustomMetric]¶
Custom metrics.
- inference_log: InferenceLogConfig | None = None¶
Analysis Configuration for monitoring inference log tables.
- notification_settings: NotificationSettings | None = None¶
Field for specifying notification settings.
- schedule: CronSchedule | None = None¶
The cron schedule.
- skip_builtin_dashboard: bool | None = None¶
Whether to skip creating a default dashboard summarizing data quality metrics.
- slicing_exprs: list[str]¶
List of column expressions to slice data with for targeted analysis. The data is grouped by each expression independently, resulting in a separate slice for each predicate and its complements. For example slicing_exprs=[“col_1”, “col_2 > 10”] will generate the following slices: two slices for col_2 > 10 (True and False), and one slice per unique value in col1. For high-cardinality columns, only the top 100 unique values by frequency will generate slices.
- snapshot: SnapshotConfig | None = None¶
Analysis Configuration for monitoring snapshot tables.
- time_series: TimeSeriesConfig | None = None¶
Analysis Configuration for monitoring time series tables.
- class DataProfilingCustomMetric¶
Custom metric definition.
- definition: str¶
Jinja template for a SQL expression that specifies how to compute the metric. See create metric definition.
- type: DataProfilingCustomMetricType¶
The type of the custom metric.
- class DataProfilingCustomMetricType¶
The custom metric type.
- DATA_PROFILING_CUSTOM_METRIC_TYPE_AGGREGATE = 'DATA_PROFILING_CUSTOM_METRIC_TYPE_AGGREGATE'¶
- DATA_PROFILING_CUSTOM_METRIC_TYPE_DERIVED = 'DATA_PROFILING_CUSTOM_METRIC_TYPE_DERIVED'¶
- DATA_PROFILING_CUSTOM_METRIC_TYPE_DRIFT = 'DATA_PROFILING_CUSTOM_METRIC_TYPE_DRIFT'¶
- class DataQualityMonitor¶
Monitor for the data quality of unity catalog entities such as schema or table.
- object_id: str¶
The UUID of the request object. It is schema_id for schema, and table_id for table.
Find the schema_id from either: 1. The schema_id of the Schemas resource. 2. In Catalog Explorer > select the schema > go to the Details tab > the Schema ID field.
Find the table_id from either: 1. The table_id of the Tables resource. 2. In Catalog Explorer > select the table > go to the Details tab > the Table ID field.
- anomaly_detection_config: AnomalyDetectionConfig | None = None¶
Anomaly Detection Configuration, applicable to schema object types.
- data_profiling_config: DataProfilingConfig | None = None¶
Data Profiling Configuration, applicable to table object types. Exactly one Analysis Configuration must be present.
- class DependsOn¶
- class InferenceLogConfig¶
Inference log configuration.
- problem_type: InferenceProblemType¶
Problem type the model aims to solve.
- granularities: list[AggregationGranularity]¶
List of granularities to use when aggregating data into time windows based on their timestamp.
- class InferenceProblemType¶
Inference problem type the model aims to solve.
- INFERENCE_PROBLEM_TYPE_CLASSIFICATION = 'INFERENCE_PROBLEM_TYPE_CLASSIFICATION'¶
- INFERENCE_PROBLEM_TYPE_REGRESSION = 'INFERENCE_PROBLEM_TYPE_REGRESSION'¶
- class Lifecycle¶
- depends_on: list[DependsOn]¶
Resources that must be deployed before this resource and deleted after it. Unlike variable references, this only affects ordering.
- class NotificationDestination¶
Destination of the data quality monitoring notification.
- destination_ids: list[str]¶
The notification-destination IDs (Slack / Teams / webhook) to send the notification to. The destinations must already exist in the workspace; a workspace admin creates them. A maximum of 25 destination IDs is supported. Only supported on schema monitors, via anomaly_detection_config; rejected on table monitors.
- destination_user_ids: list[int]¶
The IDs of the workspace users to notify by email. A maximum of 25 user IDs is supported. Only supported on schema monitors, via anomaly_detection_config; rejected on table monitors.
- class NotificationSettings¶
Settings for sending notifications on the data quality monitoring.
- on_failure: NotificationDestination | None = None¶
Destinations to send notifications on failure/timeout.
- on_unhealthy_table: NotificationDestination | None = None¶
Recipients to notify when anomaly detection finds unhealthy tables in the schema. Each recipient gets one notification per important unhealthy table. Only supported on schema monitors, via anomaly_detection_config.
- class SnapshotConfig¶
Snapshot analysis configuration.
- class TimeSeriesConfig¶
Time series analysis configuration.
- granularities: list[AggregationGranularity]¶
List of granularities to use when aggregating data into time windows based on their timestamp.