Commit 761193b
committed
feat(kernel): wire statement query tags + http_headers/user_agent on use_kernel
Consume the kernel surface from kernel PR (query tags + custom HTTP
headers) on the use_kernel path. Bumps KERNEL_REV.
Query tags (statement-level):
- execute_command no longer raises NotSupportedError for query_tags;
it calls stmt.set_query_tags(query_tags) after set_sql. The connector
already passes Dict[str, Optional[str]], which the kernel accepts
(None value -> bare key in the SEA query_tags conf).
http_headers + user_agent_entry:
- The kernel client now forwards http_headers to the kernel Session as
the `http_headers` kwarg (was accept-and-ignore). session.py already
passes all_headers, which carries the connector's composed User-Agent
(PyDatabricksSqlConnector/x (entry)) + caller headers + SPOG org-id.
- The kernel applies them per request: its own Authorization / org-id
win; a caller User-Agent is APPENDED to the kernel base UA (the base
carries the DatabricksJDBCDriverOSS token that gates the SEA result
disposition, so it's never replaced). So user_agent_entry is honored
end-to-end via the existing http_headers forwarding — no separate
kwarg needed.
Tests:
- unit: query_tags forwarded to set_query_tags (was: rejection test);
http_headers forwarded to the kernel Session (and omitted when empty).
- e2e (test_kernel_backend.py): a query_tagged query and a connection
with user_agent_entry + a custom http_header both round-trip green
against a dogfood warehouse. The UA case specifically guards the
append behavior (replacing the base UA would 400 on the result
disposition).
KERNEL_REV -> c2053f68b75fef4a29425096dc6bbafb774d8b83 (kernel PR #119
branch HEAD; re-pin to the squash-merge SHA once #119 lands).
194 kernel unit tests pass; black + mypy clean; 3 e2e pass live.
Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>1 parent 91cd0a6 commit 761193b
4 files changed
Lines changed: 133 additions & 23 deletions
File tree
- src/databricks/sql/backend/kernel
- tests
- e2e
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
| |||
187 | 193 | | |
188 | 194 | | |
189 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
| |||
208 | 223 | | |
209 | 224 | | |
210 | 225 | | |
| 226 | + | |
211 | 227 | | |
212 | 228 | | |
213 | 229 | | |
| |||
304 | 320 | | |
305 | 321 | | |
306 | 322 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | 323 | | |
312 | 324 | | |
313 | 325 | | |
| |||
321 | 333 | | |
322 | 334 | | |
323 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
324 | 343 | | |
325 | 344 | | |
326 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
336 | 340 | | |
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
340 | 344 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
355 | 372 | | |
356 | 373 | | |
357 | 374 | | |
| |||
1015 | 1032 | | |
1016 | 1033 | | |
1017 | 1034 | | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
0 commit comments