Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6cd9f02
move criticiality of rule inro _validate_attributes
cornzyblack Jul 17, 2025
98371b7
since criticality is validated after creation, filter by criticality …
cornzyblack Jul 17, 2025
1a58e16
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Jul 18, 2025
98803bc
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Jul 23, 2025
acf3767
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Jul 24, 2025
0766f2b
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Aug 2, 2025
3d0fd34
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Aug 7, 2025
e5712fc
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Aug 7, 2025
9bf6d98
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Aug 13, 2025
1e4d783
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Sep 1, 2025
fcdb1ce
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Sep 8, 2025
2393404
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Sep 16, 2025
eddc874
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Sep 19, 2025
c378b6d
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Sep 25, 2025
cb6f9ef
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Oct 15, 2025
9e4f192
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Dec 18, 2025
124e895
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Jan 10, 2026
f374908
Merge branch 'main' of github.com:cornzyblack/dqx
cornzyblack Jan 10, 2026
d5eb579
refactor: use special characters
cornzyblack Jan 10, 2026
257cd60
chore: create one function to handle SDK table location
cornzyblack Jan 10, 2026
4ab7169
chore: formatting
cornzyblack Jan 10, 2026
7a02a39
use spark.catalog.tableExists
mwojtyczka Jan 14, 2026
1850fda
improve existing tests
mwojtyczka Jan 14, 2026
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
5 changes: 3 additions & 2 deletions src/databricks/labs/dqx/checks_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from sqlalchemy.schema import CreateSchema
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.exc import DatabaseError, ProgrammingError, OperationalError, IntegrityError

from urllib.parse import quote

import yaml
from pyspark.sql import SparkSession
Expand Down Expand Up @@ -107,7 +107,8 @@ def load(self, config: TableChecksStorageConfig) -> list[dict]:
NotFound: if the table does not exist in the workspace
"""
logger.info(f"Loading quality rules (checks) from table '{config.location}'")
if not self.ws.tables.exists(config.location).table_exists:
api_ready_location = quote(config.location.replace("`", ""))
if not self.ws.tables.exists(api_ready_location).table_exists:
Comment thread
mwojtyczka marked this conversation as resolved.
Outdated
raise NotFound(f"Checks table {config.location} does not exist in the workspace")
rules_df = self.spark.read.table(config.location)
return serialize_checks_from_dataframe(rules_df, run_config_name=config.run_config_name) or []
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/test_save_and_load_checks_from_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ def test_load_checks_when_checks_table_does_not_exist(ws, make_schema, make_rand
config = TableChecksStorageConfig(location=table_name)
engine.load_checks(config=config)

def test_load_checks_with_special_characters_in_table_name(ws, make_schema, make_random, spark):
catalog_name = TEST_CATALOG
schema_name = make_schema(catalog_name=catalog_name).name
table_name = f"`{catalog_name}`.`{schema_name}`.`table-with-special_chars$#{make_random(5)}`"

engine = DQEngine(ws, spark)
config = TableChecksStorageConfig(location=table_name, run_config_name="default")
engine.save_checks(INPUT_CHECKS, config=config)
checks = engine.load_checks(config=config)
assert checks == EXPECTED_CHECKS, "Checks were not loaded correctly."


def test_save_and_load_checks_from_table(ws, make_schema, make_random, spark):
catalog_name = TEST_CATALOG
Expand Down