Commit 54e8040
fix: capability detection for named compute (
Resolves #1354
### Description
Fixes a timing bug where `table_format='iceberg'` (and other
capability-gated features) fail with "iceberg requires DBR 14.3+" when
the model targets a named compute via `databricks_compute` model config,
even though the compute supports the required DBR version.
### Fix
One-line change: call `_cache_dbr_capabilities()` eagerly in
`_create_fresh_connection()` before reading the cache. This ensures the
DBR version is queried and cached at connection creation time rather
than waiting for the lazy open(). The call is idempotent (guarded by if
`http_path` not in cache), so for default compute with a warm cache it's
a no-op.
### Key changes
- `dbt/adapters/databricks/connections.py`: Added
`self._cache_dbr_capabilities(creds, conn.http_path)` before
`conn.capabilities =
self._get_capabilities_for_http_path(conn.http_path)` in
`_create_fresh_connection()`
- `tests/unit/test_connection_manager.py`: Added 3 unit tests validating
eager caching for named compute, fallback behavior when cache is empty,
and idempotency for default compute with a warm cache
### Checklist
- [x] I have run this code in development and it appears to resolve the
stated issue
- [x] This PR includes tests, or tests are not required/relevant for
this PR
- [ ] I have updated the `CHANGELOG.md` and added information about my
change to the "dbt-databricks next" section.
---------
Signed-off-by: trouze <tyler@tylerrouze.com>
Co-authored-by: Shubham Dhal <shubham.dhal@databricks.com>databricks_compute) (#1355)1 parent ea6a384 commit 54e8040
File tree
2 files changed
+79
-1
lines changed- dbt/adapters/databricks
- tests/unit
2 files changed
+79
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
| |||
288 | 305 | | |
289 | 306 | | |
290 | 307 | | |
| 308 | + | |
291 | 309 | | |
292 | 310 | | |
293 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
0 commit comments