Skip to content

Fork test: PR #1259 - Migrate Configs and Rules to Pydantic#1272

Open
mwojtyczka wants to merge 8 commits into
mainfrom
fork-test/pr-1259
Open

Fork test: PR #1259 - Migrate Configs and Rules to Pydantic#1272
mwojtyczka wants to merge 8 commits into
mainfrom
fork-test/pr-1259

Conversation

@mwojtyczka

Copy link
Copy Markdown
Contributor

Automated sync from fork PR for CI testing.

Original PR: #1259

All tests, including unit and integration tests run on this PR (they are skipped for fork PRs).

fedeflowers and others added 8 commits June 19, 2026 21:07
Migrate storage configs, ChecksValidationStatus and the DQRule family to
Pydantic v2 BaseModel. WorkspaceConfig/RunConfig and their nested config tree
stay as dataclasses because databricks-labs-blueprint's Installation load/save
dispatches on dataclasses.is_dataclass() and __dataclass_fields__.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Revert location/columns type widening that broke mypy (str|None cascaded
  into checks_storage.py; widened columns broke manager.py and get_rules).
  Empty/None location now rejected in @model_validator(mode='before') so the
  DQX-specific InvalidConfigError/InvalidParameterError is still raised before
  Pydantic coercion; None elements in columns rejected the same way.
- Declare _expected_rule_type/_alternative_rules as ClassVar on DQRuleTypeMixin
  so subclass ClassVar overrides no longer trip mypy.
- Use plain mutable field defaults ({}/[]) instead of Field(default_factory=...)
  (Pydantic v2 deep-copies per instance) to clear pylint FieldInfo no-member.
- Use self.__class__ is not X instead of type(self) for exact-type guards.
- Add pydantic to uv.lock via make lock-dependencies (was missing from the
  databricks-labs-dqx dependency block).

make lint (black, ruff, mypy, pylint 10/10) and 1134 unit tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ace, aliased ChecksValidationStatus.errors, model_copy in lakebase test)
…ttable field (extra=forbid) and add validating BaseChecksStorageConfig.replace(); use it in lakebase test instead of validation-skipping model_copy
@mwojtyczka mwojtyczka requested a review from a team as a code owner June 24, 2026 09:48
@mwojtyczka mwojtyczka requested review from pratikk-databricks and removed request for a team June 24, 2026 09:48
@mwojtyczka mwojtyczka added do-not-merge The PR is blocked, e.g. being worked on and not ready. Not using draft to be able to test changes. fork-test labels Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.95918% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.86%. Comparing base (9980c98) to head (7a8a546).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/databricks/labs/dqx/config.py 98.11% 1 Missing ⚠️
src/databricks/labs/dqx/engine.py 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (9980c98) and HEAD (7a8a546). Click for more details.

HEAD has 42 uploads less than BASE
Flag BASE (9980c98) HEAD (7a8a546)
unit 9 1
anomaly 9 1
anomaly-serverless 9 1
integration-serverless 9 0
integration 9 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1272       +/-   ##
===========================================
- Coverage   92.56%   73.86%   -18.71%     
===========================================
  Files         102      102               
  Lines       10075    10105       +30     
===========================================
- Hits         9326     7464     -1862     
- Misses        749     2641     +1892     
Flag Coverage Δ
anomaly 13.92% <8.16%> (-40.45%) ⬇️
anomaly-serverless 54.32% <69.38%> (-0.06%) ⬇️
integration ?
integration-serverless ?
unit 57.14% <97.95%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

❌ 786/788 passed, 2 failed, 41 skipped, 5h15m58s total

❌ test_load_checks_invalid_storage_config: TypeError: ChecksDummyStorageConfig.__init__() missing 1 required positional argument: 'location' (1.349s)
TypeError: ChecksDummyStorageConfig.__init__() missing 1 required positional argument: 'location'
10:11 INFO [tests.conftest] Overriding DATABRICKS_CLUSTER_ID with DATABRICKS_DQX_CLUSTER_ID: DATABRICKS_DQX_CLUSTER_ID
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw4] linux -- Python 3.12.3 /home/runner/work/dqx/dqx/.venv/bin/python
10:11 INFO [tests.conftest] Overriding DATABRICKS_CLUSTER_ID with DATABRICKS_DQX_CLUSTER_ID: DATABRICKS_DQX_CLUSTER_ID
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [tests.conftest] Overriding DATABRICKS_CLUSTER_ID with DATABRICKS_DQX_CLUSTER_ID: DATABRICKS_DQX_CLUSTER_ID
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw4] linux -- Python 3.12.3 /home/runner/work/dqx/dqx/.venv/bin/python
❌ test_save_checks_invalid_storage_config: TypeError: ChecksDummyStorageConfig.__init__() missing 1 required positional argument: 'location' (1.213s)
TypeError: ChecksDummyStorageConfig.__init__() missing 1 required positional argument: 'location'
10:11 INFO [tests.conftest] Overriding DATABRICKS_CLUSTER_ID with DATABRICKS_DQX_CLUSTER_ID: DATABRICKS_DQX_CLUSTER_ID
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw4] linux -- Python 3.12.3 /home/runner/work/dqx/dqx/.venv/bin/python
10:11 INFO [tests.conftest] Overriding DATABRICKS_CLUSTER_ID with DATABRICKS_DQX_CLUSTER_ID: DATABRICKS_DQX_CLUSTER_ID
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [tests.conftest] Overriding DATABRICKS_CLUSTER_ID with DATABRICKS_DQX_CLUSTER_ID: DATABRICKS_DQX_CLUSTER_ID
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
10:11 INFO [databricks.sdk] Using Databricks Metadata Service authentication
[gw4] linux -- Python 3.12.3 /home/runner/work/dqx/dqx/.venv/bin/python

Running from acceptance #4935

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

✅ 177/177 passed, 2 skipped, 9h16m29s total

Running from anomaly #1049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge The PR is blocked, e.g. being worked on and not ready. Not using draft to be able to test changes. fork-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants