Skip to content
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
aedf6ae
LLM assisted rules generation code
souravg-db2 Sep 15, 2025
a081731
added change for tests
souravg-db2 Sep 15, 2025
985d80c
Addressed fmt issues
souravg-db2 Sep 15, 2025
40d0b6c
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Sep 16, 2025
353222c
refactor
mwojtyczka Sep 16, 2025
c2ee51e
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Sep 18, 2025
e7b94ce
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Sep 19, 2025
4fddaef
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Sep 30, 2025
0e37f34
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 2, 2025
015bff3
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 3, 2025
82cfcff
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 7, 2025
cdf231c
added few changes
souravg-db2 Oct 8, 2025
032a18c
Removed removed which was not needed
souravg-db2 Oct 9, 2025
34d9782
Merge branch 'main' into feature_370_llm_prompt_prep_3
souravg-db2 Oct 10, 2025
ed42bc9
Added changes to call llm rules generation from generator
souravg-db2 Oct 10, 2025
4993453
Add schema inference for no-schema provided DQ rule generation
vb-dbrks Oct 10, 2025
a4d73e6
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 16, 2025
0602e16
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 16, 2025
ab89982
Addressed some review comments
souravg-db2 Oct 16, 2025
cea51d7
Changes per review comments
souravg-db2 Oct 17, 2025
17482be
Changes per review comments
souravg-db2 Oct 17, 2025
14cad77
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 18, 2025
5edde34
updated clean up of lakebase instances
mwojtyczka Oct 19, 2025
4377f05
updated clean up of lakebase instances
mwojtyczka Oct 19, 2025
834c0b6
refactor
mwojtyczka Oct 19, 2025
d555fe4
revert change
mwojtyczka Oct 20, 2025
1a2591f
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 21, 2025
894c7b5
added documentation and updated default model
souravg-db2 Oct 26, 2025
85d1089
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Oct 30, 2025
9794464
Merge branch 'main' into feature_370_llm_prompt_prep_3
mwojtyczka Nov 3, 2025
f4aa2c2
refactor
mwojtyczka Nov 4, 2025
8cea7cc
test
mwojtyczka Nov 4, 2025
772ca69
refactor
mwojtyczka Nov 4, 2025
35eba0c
added sql query and schema validation examples
mwojtyczka Nov 4, 2025
7988b08
added comments
mwojtyczka Nov 4, 2025
d7e06ab
added unit and integration tests
mwojtyczka Nov 4, 2025
a5256cf
added llm assisted rule generation to profiler workflow
mwojtyczka Nov 5, 2025
a828231
refactor
mwojtyczka Nov 5, 2025
e6c9902
changed test catalog
mwojtyczka Nov 5, 2025
6fe4a7b
added demo notebook fo ai assisted feature
souravg-db2 Nov 5, 2025
0dded6f
removed extra cells
souravg-db2 Nov 5, 2025
d214aee
updated ai demo
mwojtyczka Nov 5, 2025
bb1d63e
updated ai demo
mwojtyczka Nov 5, 2025
576010c
updated ai demo
mwojtyczka Nov 5, 2025
17f9b48
Fixed the pip install
souravg-db2 Nov 5, 2025
e00c4e4
added integration tests, load api keys in workflows from secrets
mwojtyczka Nov 6, 2025
0e53c6c
updated docs and fixed logger
mwojtyczka Nov 6, 2025
f88bd06
copilot code review implementation
mwojtyczka Nov 6, 2025
86feb5c
copilot code review implementation
mwojtyczka Nov 6, 2025
d1f84d0
updated telemetry
mwojtyczka Nov 6, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
vault_uri: ${{ secrets.VAULT_URI }}
timeout: 2h
create_issues: true
create_issues: false # if enabled, it creates an issue for each test failure; disabled to reduce noise
codegen_path: tests/integration/.codegen.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ clean: docs-clean
.venv/bin/python:
pip install hatch
hatch env create
hatch run pip install ".[llm,pii]"

dev: .venv/bin/python
@hatch run which python
Expand All @@ -17,7 +18,6 @@ lint:
fmt:
hatch run fmt
hatch run update_github_urls
hatch run extract_checks_examples

test:
hatch run test
Expand Down
100 changes: 100 additions & 0 deletions demos/dqx_demo_ai_assisted_checks_generation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Databricks notebook source
# MAGIC %md
# MAGIC # DQX - AI Assisted Checks Generation Demo
Comment thread
mwojtyczka marked this conversation as resolved.
Outdated
# MAGIC

# COMMAND ----------

# MAGIC %md
# MAGIC # Install DQX with LLM extras
# MAGIC
# MAGIC To use DQX AI Assisted features, DQX has to be installed with `llm` extras:
# MAGIC
# MAGIC `%pip install databricks-labs-dqx[llm]`

# COMMAND ----------

dbutils.widgets.text("test_library_ref", "", "Test Library Ref")

if dbutils.widgets.get("test_library_ref") != "":
%pip install 'databricks-labs-dqx[llm] @ {dbutils.widgets.get("test_library_ref")}'
else:
%pip install databricks-labs-dqx[llm]

%restart_python

# COMMAND ----------

model_name = "databricks/databricks-claude-sonnet-4-5"
default_user_input = "customername should not start with s and account balance should be positive"
default_table_name = "samples.tpch.customer"

dbutils.widgets.text("model_name", model_name, "Model Name")
dbutils.widgets.text("user_requirement", default_user_input, "User Requirement")
dbutils.widgets.text("table_name", default_table_name, "Table Name")

model_name = dbutils.widgets.get("model_name")
user_requirement = dbutils.widgets.get("user_requirement")
table_name = dbutils.widgets.get("table_name")

# COMMAND ----------

import os, yaml
from databricks.labs.dqx.profiler.generator import DQGenerator
from databricks.labs.dqx.config import LLMModelConfig
from databricks.labs.dqx.engine import DQEngine
from databricks.sdk import WorkspaceClient

# COMMAND ----------

# Instantiate DQX engine
ws = WorkspaceClient()
dq_engine = DQEngine(ws, spark)


# COMMAND ----------

# MAGIC %md
# MAGIC ## Generating DQX Rules with AI Assistance
# MAGIC
# MAGIC DQX supports AI-assisted rule generation based on user requirements. The following configurations are available:
# MAGIC
# MAGIC - **Model Serving Endpoint**:
# MAGIC By default, DQX uses the `databricks/databricks-claude-sonnet-4-5` model serving endpoint to generate rules. However, users can specify a different model endpoint if they prefer to use another one.
# MAGIC
# MAGIC - **Table Name**:
# MAGIC Users can optionally provide the fully qualified name of a table. DQX will use the table's schema to generate rules. If no table name is provided, the schema will be inferred based on the user's input.
# MAGIC

# COMMAND ----------

# Creating model config with optional model name (default Databricks Foundational model endpoint is used if not provided)
llm_model_config = LLMModelConfig(model_name=model_name)
generator = DQGenerator(ws, llm_model_config=llm_model_config)

# COMMAND ----------

# MAGIC %md
# MAGIC ### Generate DQ rules using AI-Assisted approach using user requirement
# MAGIC
# MAGIC Schema of the data will be guessed.

# COMMAND ----------

checks = generator.generate_dq_rules_ai_assisted(user_input=user_requirement)
print("======== Generated checks =========")
print(checks)

# COMMAND ----------

# MAGIC %md
# MAGIC ### Generate DQ rules using AI-Assisted approach using user requirement and user specified table name
# MAGIC
# MAGIC Schema will be fetched from the table specified by the user.
# MAGIC

# COMMAND ----------

checks = generator.generate_dq_rules_ai_assisted(user_input=user_requirement, table_name=table_name)
print("======== Generated checks =========")
print(checks)
2 changes: 1 addition & 1 deletion docs/dqx/docs/guide/additional_configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 9
sidebar_position: 10
---

import Admonition from '@theme/Admonition';
Expand Down
Loading
Loading