Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions databricks-skills/databricks-unity-catalog/7-data-profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,28 @@ w.data_quality.delete_monitor(

---

## Anomaly Detection

Anomaly detection is enabled at the **schema level**, not per table. Once enabled, Databricks automatically scans all tables in the schema at the same frequency they are updated.

```python
from databricks.sdk.service.dataquality import Monitor, AnomalyDetectionConfig

schema_info = w.schemas.get("catalog.schema")

monitor = w.data_quality.create_monitor(
monitor=Monitor(
object_type="schema",
object_id=schema_info.schema_id,
anomaly_detection_config=AnomalyDetectionConfig(),
),
)
```

> **Note:** Anomaly detection requires `MANAGE SCHEMA` or `MANAGE CATALOG` privileges and serverless compute enabled on the workspace.

---

## Output Tables

When a monitor is created, two metric tables are generated in the specified output schema:
Expand Down
Loading