Skip to content
Merged
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
b333413
refactor: delete only records for specific run_config_name
tlgnr Sep 10, 2025
377493d
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Sep 18, 2025
9faa77c
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Sep 19, 2025
f61ef7e
refactor: use sqlalchemy for saving and loading checks to Lakebase
tlgnr Sep 22, 2025
18173fa
pull in remote changes and resolve merge conflict in config.py
tlgnr Sep 22, 2025
269720b
refactor: make load checks exception more specific
tlgnr Sep 22, 2025
0683135
refactor: remove connection info class and provide external engine fo…
tlgnr Sep 22, 2025
8445740
test: add test for lakebase load checks functionality
tlgnr Sep 22, 2025
8d97cd6
refactor: remove threaded connection pool
tlgnr Sep 24, 2025
b7c0803
style: remove blank line
tlgnr Sep 24, 2025
18bd6bb
refactor: only dispose engines that were created internally
tlgnr Sep 24, 2025
0e72f0c
Merge branch 'feature_503_store_retrieve_checks' of github.com:databr…
tlgnr Sep 24, 2025
10528f7
refactor: enable providing a custom user for connecting to lakebase
tlgnr Sep 24, 2025
4ba265f
refactor: supply lakebase user only from config
tlgnr Sep 24, 2025
c59aa7f
feature: add lakebase implementation for installationchecksstoragehan…
tlgnr Sep 24, 2025
c697d51
test: add and refine tests for saving and loading checks
tlgnr Sep 24, 2025
d51c886
style: remove trailing whitespace
tlgnr Sep 25, 2025
8cf705a
style: remove trailing whitespace
tlgnr Sep 25, 2025
457cb06
refactor: remove redundant database query
tlgnr Sep 25, 2025
2862b22
Merge branch 'feature_503_store_retrieve_checks' of github.com:databr…
tlgnr Sep 25, 2025
cb194dc
refactor: move parse_lakebase_config to lakebasechecksstorageconfig
tlgnr Sep 25, 2025
694f86a
refactor: change structure of lakebasechecksstoragehandler
tlgnr Sep 26, 2025
6d02f17
refactor: make lakebase port a string
tlgnr Sep 26, 2025
2d7c011
refactor: remove code duplication
tlgnr Sep 26, 2025
7e1de5a
refactor: change order of if statements
tlgnr Sep 26, 2025
3d0c803
refactor: add default value in installationchecksstorageconfig for co…
tlgnr Sep 26, 2025
cc21466
refactor: streamline unit test for lakebasechecksstoragehandler
tlgnr Sep 26, 2025
0b88f5a
style: insert line break
tlgnr Sep 26, 2025
2af23a2
refactor: revise load lakebasechecksstoragehandler test
tlgnr Sep 26, 2025
8af2638
Merge branch 'feature_503_store_retrieve_checks' of github.com:databr…
tlgnr Sep 26, 2025
31036d9
chore: add testing library to project.toml
tlgnr Sep 29, 2025
c60637f
chore: add psycopg2-binary library to projec.toml
tlgnr Sep 29, 2025
43c3cfb
fix: allow connection_string to be optional in LakebaseChecksStorageC…
tlgnr Sep 29, 2025
b28443d
fix: add quotation marks to library name
tlgnr Sep 29, 2025
166f60f
refactor: simplify unit test test_lakebase_checks_storage_handler_load
tlgnr Sep 29, 2025
d8108ee
docs: remove errant paranthesis
tlgnr Sep 29, 2025
edc0fa3
refactor: allow connection_string in _parse_connection_string method …
tlgnr Sep 29, 2025
4977442
chore: exclude testing packet from type checking
tlgnr Sep 29, 2025
010166d
chore: exclude testing.* library from type checking
tlgnr Sep 29, 2025
01ba123
refactor: simplified load and save Lakebase checks test cases
tlgnr Sep 29, 2025
08ba302
refactor: apply code review suggestions
tlgnr Sep 29, 2025
75bb153
refactor: reorder import statements for better organization
tlgnr Sep 30, 2025
bd069f8
refactor: simplify saving and loading checks to Lakebase
tlgnr Sep 30, 2025
29fa231
refactor: consolidate save and load tests
tlgnr Sep 30, 2025
f117c56
fix: add type annotations to utils file
tlgnr Sep 30, 2025
5b33689
refactor: remove redundant code
tlgnr Sep 30, 2025
a977bc4
refactor: harmonize test checks
tlgnr Sep 30, 2025
47ec21d
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Sep 30, 2025
ec9cfff
refactor: update import statement for testing.postgresql
tlgnr Sep 30, 2025
573126c
refactor: improve error handling in Lakebase checks storage
tlgnr Sep 30, 2025
75dd08c
merge: merge in changes from main branch
tlgnr Sep 30, 2025
3579c40
fix: update database instance reference in LakebaseChecksStorageHandler
tlgnr Sep 30, 2025
e089110
refactor: use InvalidParameterError instead of ValueError
tlgnr Oct 1, 2025
60d1db1
refactor: use InvalidParameterError instead of ValueError
tlgnr Oct 1, 2025
5b8d964
refactor: use InvalidParameterError instead of ValueError
tlgnr Oct 1, 2025
628e451
refactor: use InvalidParameterError instead of ValueError
tlgnr Oct 1, 2025
969b267
refactor: move and redefine utility functions for comparing checks
tlgnr Oct 1, 2025
b98bedc
merge: merge in remote changes
tlgnr Oct 1, 2025
4c94611
chore: import InvalidParameterError
tlgnr Oct 1, 2025
9a9017b
feat: add connection_string attribute to RunConfig for Lakebase insta…
tlgnr Oct 1, 2025
8f53150
feat: normalize checks and improve error handling in LakebaseChecksSt…
tlgnr Oct 1, 2025
419d688
docs: document Lakebase columns
tlgnr Oct 1, 2025
dc9e05b
feat: add pytest fixture for Lakebase connection_string
tlgnr Oct 1, 2025
839e4b6
feat: add integration tests
tlgnr Oct 1, 2025
fe923ac
fix: enhance error handling in LakebaseChecksStorageHandler
tlgnr Oct 1, 2025
a78c2cc
refactor: remove redundant import
tlgnr Oct 1, 2025
bf311b7
refactor: standardize LOCATION variable usage in Lakebase checks tests
tlgnr Oct 1, 2025
b36a5d3
refactor: streamline error handling in LakebaseChecksStorageHandler
tlgnr Oct 1, 2025
2a30ce8
fix: correct substitution error
tlgnr Oct 1, 2025
aecc1d1
refactor: remove code redundancies
tlgnr Oct 1, 2025
2e59930
feat: add DATABRICKS_HOST secret environment variable
tlgnr Oct 2, 2025
c34fe8c
refactor: upgrade databricks-sdk version
tlgnr Oct 2, 2025
42f059e
refactor: move unit tests to integration tests due to spark argument
tlgnr Oct 2, 2025
caeb5d7
refactor: update integration tests to use pytest fixture
tlgnr Oct 2, 2025
45f5d20
refactor: update error message
tlgnr Oct 2, 2025
4318d1d
refactor: place create schema and write to table in two separate tran…
tlgnr Oct 2, 2025
554be45
fix: correct argument in connection string
tlgnr Oct 2, 2025
0af1634
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Oct 2, 2025
0bdb932
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Oct 2, 2025
c703f97
fmt
mwojtyczka Oct 3, 2025
48b7a56
refactor
mwojtyczka Oct 3, 2025
fb52acc
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Oct 3, 2025
93184fa
force delete db instance in fixture
mwojtyczka Oct 3, 2025
3fd4b34
Merge branch 'main' into feature_503_store_retrieve_checks
tlgnr Oct 6, 2025
1dd0fbf
fix: remove errant argument from database delete function
tlgnr Oct 6, 2025
f7b2262
Merge branch 'feature_503_store_retrieve_checks' of github.com:databr…
tlgnr Oct 6, 2025
0d7604f
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Oct 7, 2025
3cd2a31
fix: clean up old test instances
tlgnr Oct 7, 2025
ce3371c
Merge branch 'feature_503_store_retrieve_checks' of github.com:databr…
tlgnr Oct 7, 2025
6e77a5b
docs: reformat docstring
tlgnr Oct 7, 2025
6e971f7
refactor: remove connection string argument
tlgnr Oct 8, 2025
02734c5
refactor: removed postgresql tests
tlgnr Oct 8, 2025
e6f07a9
chore: update unit tests
tlgnr Oct 8, 2025
6d50bf1
chore: update InstallationChecksStorageConfig
tlgnr Oct 8, 2025
b085f94
chore: update integration tests
tlgnr Oct 8, 2025
6117b22
chore: update import order
tlgnr Oct 8, 2025
5532e30
chore: update import order
tlgnr Oct 8, 2025
4052eea
Merge branch 'feature_503_store_retrieve_checks' of github.com:databr…
tlgnr Oct 8, 2025
7ba287e
chore: update lakebase run config name test
tlgnr Oct 8, 2025
824409d
refactor: remove sqlalchemy null function
tlgnr Oct 8, 2025
2c06a2c
fix: remove old instances
tlgnr Oct 8, 2025
b17d53d
chore: remove instance cleanup function
tlgnr Oct 8, 2025
600117f
fix: make product name dynamic in test
tlgnr Oct 9, 2025
780914b
refactor: streamline lakebase integration tests
tlgnr Oct 9, 2025
f679f3a
feat: extend DQEngine with Lakebase storage handler and config
tlgnr Oct 9, 2025
214e3ea
chore: clean up pyproject.toml
tlgnr Oct 9, 2025
d95d190
docs: make docstring more concise
tlgnr Oct 9, 2025
07bb2c6
fix: harmonize fixture names
tlgnr Oct 9, 2025
f5b56fe
chore: merge in remote changes
tlgnr Oct 9, 2025
4507513
fix: add back quotation marks copilot review deleted
tlgnr Oct 9, 2025
2395102
refactor: improve error handling in load checks method
tlgnr Oct 9, 2025
b71982f
chore: merge in changes from main branch
tlgnr Oct 9, 2025
5591bbf
style: edit whitespace
tlgnr Oct 10, 2025
ea805bf
fix: add abstract method to BaseChecksStorageHandlerFactory
tlgnr Oct 10, 2025
4d26ee1
fix: add back psycopg2 library
tlgnr Oct 10, 2025
7d6b033
refactor: check if database exists and improve error handling
tlgnr Oct 10, 2025
abd7aed
fix: correct spelling mistake
tlgnr Oct 10, 2025
58e85c3
refactor: further refine error handling
tlgnr Oct 10, 2025
067a4e7
refactor: simplify error handling
tlgnr Oct 10, 2025
0a9e64e
fix: correct indent
tlgnr Oct 10, 2025
e39479c
fix: properly handle None values in InstallationChecksStorageHandler …
tlgnr Oct 13, 2025
bdcdd2a
style: extract yaml string
tlgnr Oct 13, 2025
b6687ef
refactor: simplify error handling
tlgnr Oct 13, 2025
dfd2636
docs: extend docs with references to LakebaseChecksStorageConfig
tlgnr Oct 13, 2025
ce8bbd8
refactor: transfer attribute values from run config if not already set
tlgnr Oct 13, 2025
9815f27
refactor: add logging and improve run config handling
tlgnr Oct 13, 2025
ea7e4cd
refactor: reduce parallelism in integration tests
tlgnr Oct 13, 2025
a8c8003
fix: clean up old test instances
tlgnr Oct 14, 2025
b3b3da0
fix: clean up left over lakebase instances
tlgnr Oct 14, 2025
63b2573
chore: remove cleanup step
tlgnr Oct 14, 2025
941e7f0
refactor: set port in RunConfig by default to None
tlgnr Oct 14, 2025
39943c4
refactor: ensure empty user_metadata is null
tlgnr Oct 14, 2025
884a597
refactor: harmonize RunConfig and LakebaseChecksStorageConfig port de…
tlgnr Oct 14, 2025
0347223
refactor to remove duplicated fields
mwojtyczka Oct 15, 2025
f068741
refactor
mwojtyczka Oct 15, 2025
17eb866
refactor
mwojtyczka Oct 15, 2025
77bddf4
Merge branch 'main' into feature_503_store_retrieve_checks
mwojtyczka Oct 15, 2025
c5b9a60
fmt
mwojtyczka Oct 15, 2025
4761283
refactor
mwojtyczka Oct 15, 2025
2c67137
docs: add example for Lakebase in config.yml
tlgnr Oct 15, 2025
0b2da5b
updated logic
mwojtyczka Oct 15, 2025
805ebae
refactor
mwojtyczka Oct 15, 2025
1d56cc3
fmt
mwojtyczka Oct 15, 2025
35352a7
updated tests
mwojtyczka Oct 15, 2025
6b9db1a
fmt
mwojtyczka Oct 15, 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 docs/dqx/docs/guide/data_profiling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ When running the profiler workflow using Databricks API or UI, you have the same
- If the `checks_location` in the run config points to a table, the checks will be saved to that table.
If the `checks_location` in the run config points to a file, file name is replaced with "<input_table>.yml". In addition, if the location is specified as a relative path, it is prefixed with the workspace installation folder.
For example:
- If "checks_location=catalog.schema.table", the location will be resolved to "catalog.schema.table".
- If "checks_location=catalog.schema.table", the location will be resolved to "catalog.schema.table" or "database.schema.table" in case of using Lakebase to store checks.
- If "checks_location=folder/checks.yml", the location will be resolved to "install_folder/folder/<input_table>.yml".
- If "checks_location=/App/checks.yml", the location will be resolved to "/App/<input_table>.yml".
- If "checks_location=/Volume/catalog/schema/folder/checks.yml", the location will be resolved to "/Volume/catalog/schema/folder/<input_table>.yml".
Expand Down
4 changes: 2 additions & 2 deletions docs/dqx/docs/guide/quality_checks_apply.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ When running the quality checker workflow using Databricks API or UI, you have t
- If the `checks_location` in the run config points to a table, the checks will be directly loaded from that table.
If the `checks_location` in the run config points to a file, file name is replaced with "<input_table>.yml". In addition, if the location is specified as a relative path, it is prefixed with the workspace installation folder.
For example:
- If "checks_location=catalog.schema.table", the location will be resolved to "catalog.schema.table".
- If "checks_location=catalog.schema.table", the location will be resolved to "catalog.schema.table" or "database.schema.table" in case of using Lakebase to store checks.
- If "checks_location=folder/checks.yml", the location will be resolved to "install_folder/folder/<input_table>.yml".
- If "checks_location=/App/checks.yml", the location will be resolved to "/App/<input_table>.yml".
- If "checks_location=/Volume/catalog/schema/folder/checks.yml", the location will be resolved to "/Volume/catalog/schema/folder/<input_table>.yml".
Expand Down Expand Up @@ -688,7 +688,7 @@ When running the e2e workflow using Databricks API or UI, you have the same exec
- If the `checks_location` in the run config points to a table, the checks will be directly loaded from that table.
If the `checks_location` in the run config points to a file, file name is replaced with <input_table>.yml. In addition, if the location is specified as a relative path, it is prefixed with the workspace installation folder.
For example:
- If "checks_location=catalog.schema.table", the location will be resolved to "catalog.schema.table".
- If "checks_location=catalog.schema.table", the location will be resolved to "catalog.schema.table" or "database.schema.table" in case of using Lakebase to store checks.
- If "checks_location=folder/checks.yml", the location will be resolved to "install_folder/folder/<input_table>.yml".
- If "checks_location=/App/checks.yml", the location will be resolved to "/App/<input_table>.yml".
- If "checks_location=/Volume/catalog/schema/folder/checks.yml", the location will be resolved to "/Volume/catalog/schema/folder/<input_table>.yml".
Expand Down
19 changes: 17 additions & 2 deletions docs/dqx/docs/guide/quality_checks_storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ Saving and loading methods accept a storage backend configuration as input. The
* `mode`: (optional) write mode for saving checks (`overwrite` or `append`, default is `overwrite`). The `overwrite` mode will only replace checks for the specific run config and not all checks in the table.
* `VolumeFileChecksStorageConfig`: Unity Catalog Volume (JSON/YAML file). Containing fields:
* `location`: Unity Catalog Volume file path (JSON or YAML).
* `LakebaseChecksStorageConfig`: Lakebase table. Containing fields:
* `instance_name`: name of the Lakebase instance, e.g., "my-instance".
* `user`: user to connect to the Lakebase instance, e.g., "user@domain.com" or Databricks service principal client ID.
* `location`: fully-qualified table name in the format "database.schema.table".
* `port`: (optional) port on which to connect to the Lakebase instance (use 5432 if not provided).
* `run_config_name`: (optional) run configuration name to load (use "default" if not provided).
* `mode`: (optional) write mode for saving checks (`overwrite` or `append`, default is `overwrite`). The `overwrite` mode will only replace checks for the specific run config and not all checks in the table.
* `InstallationChecksStorageConfig`: installation-managed location from the run config, ignores location and infers it from `checks_location` in the run config. Containing fields:
* `location` (optional): automatically set based on the `checks_location` field from the run configuration.
* `install_folder`: (optional) installation folder where DQX is installed, only required when custom installation folder is used.
Expand Down Expand Up @@ -49,7 +56,8 @@ If you create checks as a list of `DQRule` objects, you can convert them to meta
WorkspaceFileChecksStorageConfig,
InstallationChecksStorageConfig,
TableChecksStorageConfig,
VolumeFileChecksStorageConfig
VolumeFileChecksStorageConfig,
LakebaseChecksStorageConfig,
)
from databricks.sdk import WorkspaceClient

Expand Down Expand Up @@ -81,6 +89,9 @@ If you create checks as a list of `DQRule` objects, you can convert them to meta
# save checks as a YAML in a Unity Catalog Volume location (overwrite the file)
dq_engine.save_checks(checks, config=VolumeFileChecksStorageConfig(location="/Volumes/dq/config/checks_volume/App1/checks.yml"))

# save checks as a Lakebase table using a Databricks service principal
dq_engine.save_checks(checks, config=LakebaseChecksStorageConfig(instance_name="my-instance", user="00000000-0000-0000-0000-000000000000", location="dqx.config.checks"))

# save checks as a YAML file or table defined in 'checks_location' of the run config
# only works if DQX is installed in the workspace
dq_engine.save_checks(checks, config=InstallationChecksStorageConfig(assume_user=True, run_config_name="default"))
Expand Down Expand Up @@ -194,7 +205,8 @@ If you create checks as a list of DQRule objects, you can convert them using the
WorkspaceFileChecksStorageConfig,
InstallationChecksStorageConfig,
TableChecksStorageConfig,
VolumeFileChecksStorageConfig
VolumeFileChecksStorageConfig,
LakebaseChecksStorageConfig,
)
from databricks.sdk import WorkspaceClient

Expand All @@ -216,6 +228,9 @@ If you create checks as a list of DQRule objects, you can convert them using the
# load checks from a Unity Catalog Volume
checks: list[dict] = dq_engine.load_checks(config=VolumeFileChecksStorageConfig(location="/Volumes/dq/config/checks_volume/App1/checks.yml"))

# load checks from a Lakebase table using a Databricks service principal
checks: list[dict] = dq_engine.load_checks(config=LakebaseChecksStorageConfig(instance_name="my-instance", user="00000000-0000-0000-0000-000000000000", location="dqx.config.checks"))

# load checks from a file or table defined in the run config ('checks_location' field)
# only works if DQX is installed in the workspace
checks: list[dict] = dq_engine.load_checks(config=InstallationChecksStorageConfig(run_config_name="default"))
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = ["databricks-labs-blueprint>=0.9.1,<0.10",
"databricks-sdk~=0.57",
"databricks-sdk~=0.67",
"databricks-labs-lsql>=0.5,<=0.16",
"sqlalchemy>=1.4,<3.0",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -101,6 +102,7 @@ dependencies = [
"dbldatagen~=0.4.0",
"pyparsing~=3.2.3",
"jmespath~=1.0.1",
"psycopg2-binary~=2.9.10",
]

python="3.12" # must match the version required by databricks-connect and python version on the test clusters
Expand All @@ -111,7 +113,7 @@ path = ".venv"
[tool.hatch.envs.default.scripts]
test = "pytest tests/unit/ -n 10 --cov --cov-report=xml:coverage-unit.xml --timeout 30 --durations 20"
coverage = "pytest tests/ -n 10 --cov --cov-report=html --timeout 600 --durations 20"
integration = "pytest tests/integration/ -n 10 --cov --cov-report=xml --timeout 1200 --durations 20"
integration = "pytest tests/integration/ -n 5 --cov --cov-report=xml --timeout 1200 --durations 20"
e2e = "pytest tests/e2e/ -n 10 --cov --cov-report=xml --timeout 600 --durations 20"
perf = "pytest tests/perf/ -n 10 --cov --cov-report=xml --timeout 600 --durations 20"
fmt = ["black .",
Expand Down
Loading
Loading