Commit 58c2544
authored
fix(refresh): use pydantic v1-compatible API so adapter imports on DBR 15.4 (#1461)
### Description
PR #1434 added `from pydantic import model_validator` to `refresh.py`, a
v2-only symbol. This breaks adapter import on Databricks Jobs DBR 15.4
LTS, which ships pydantic v1.10.x.
This PR rewrites the three v2-only call sites to v1-compatible
equivalents that also work in v2 via the deprecation shim:
| Before (v2 only) | After (v1 + v2) |
|---|---|
| `@model_validator(mode="after")` |
`@root_validator(skip_on_failure=True)` |
| `self.model_construct(**self.model_dump(), ...)` |
`self.copy(update=...)` |
### Verification
- Unit tests: 1081 passed, 6 skipped
- Local smoke (pydantic v2): 56 PASS / 0 ERROR
- Databricks Jobs verify on DBR 15.4 LTS (pydantic v1.10.x)
- Reproduced the post-merge `Min-Deps Parse` workflow (#1460) locally
against this branch: `uv pip install --resolution lowest-direct .`
resolved pydantic to 1.10.0; `dbt parse --project-dir
tests/min_deps_smoke --profiles-dir tests/min_deps_smoke` succeeds,
confirming the fix clears the same import path that the post-merge gate
exercises.
### Checklist
- [x] Added changes to CHANGELOG.md
- [x] Unit tests pass
- [x] Functional/smoke tests pass on Databricks Jobs (DBR 15.4 LTS)1 parent f15ddfd commit 58c2544
2 files changed
Lines changed: 22 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
1 | 7 | | |
2 | 8 | | |
3 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | | - | |
| 112 | + | |
110 | 113 | | |
111 | | - | |
112 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | | - | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 124 | + | |
128 | 125 | | |
129 | 126 | | |
130 | 127 | | |
| |||
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
179 | | - | |
180 | | - | |
| 176 | + | |
| 177 | + | |
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
| |||
0 commit comments