Skip to content

Run Volume PUT, GET and REMOVE through the kernel backend - #1057

Open
aakash-saravanan-db wants to merge 4 commits into
mainfrom
aakash-saravanan_data/feat/volume-restart-20261113
Open

aakash-saravanan-db wants to merge 4 commits into
mainfrom
aakash-saravanan_data/feat/volume-restart-20261113

Conversation

@aakash-saravanan-db

@aakash-saravanan-db aakash-saravanan-db commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Feature or gap

With use_kernel=True, the connector refuses SQL PUT, GET and REMOVE on a Unity Catalog Volume, because the kernel returned the instruction row and moved no file.

What this PR addresses

The kernel now runs a Volume transfer inside execute (databricks/databricks-sql-kernel#520, #521), so the kernel backend sets the Volume options on every statement before it runs:

  • staging_allowed_local_path becomes the allowed local directories. When it is unset, an empty list still lets a REMOVE run, as on Thrift.
  • cursor.execute(..., input_stream=stream) supplies the bytes for PUT '__input_stream__'. execute_command takes the stream on every backend; Thrift and SEA ignore it.
  • A Volume result returns no rows, as on Thrift.
  • Local path and storage failures raise the same exceptions and messages as Thrift: ProgrammingError for a path outside staging_allowed_local_path, OSError for a local file error, and OperationalError "Staging operation over HTTP was unsuccessful" for a storage HTTP error.
  • Cancelling or closing the cursor stops a running transfer. _socket_timeout is the transfer's idle limit.

The guard that refused staging statements on the kernel backend is removed.

Dependencies

KERNEL_REV pins databricks/databricks-sql-kernel#521 for CI. Users get the change only after a kernel release that includes #520 and #521, with the matching dependency floor in pyproject.toml and poetry.lock.

Tests and validation

  • Unit: 1,437 passed with -m "not realkernel". New tests check that the options and input bytes reach the statement, that Volume errors match Thrift, and that a Volume result returns no rows.
  • Real kernel: the realkernel tests pass against the bindings built from KERNEL_REV.
  • Live: tests/e2e/test_kernel_backend.py runs the shared Volume and streaming-PUT suites (10 tests) against a warehouse in kernel E2E CI.

This pull request and its description were written by Isaac.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 High · 1 Medium · 1 Low

Needs changes. The main blocker is that the code relies on new kernel APIs while the dependency floor still allows older wheels, which would break every kernel query, not only Volume operations. There is also a KeyError crash when the best-effort canceller is missing.

Other findings

  • 🔵 Low — This PR deletes the kernel e2e tests for staging and adds no replacements. All new coverage uses mocks that invent is_volume_operation, complete_volume_operation return strings ("needs_input_stream", "completed", "not_volume") and exception attributes (local_os_error, http_status, local_path). Nothing in CI checks that the real kernel binding actually has these names and values. Please add kernel e2e cases, such as PUT→GET→REMOVE round trips (file and input_stream) and a rejected symlink outside the allowed root, so a mismatch with the kernel contract fails the build.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 High · 1 Medium · 2 Nit

Needs changes: 1 high, 1 medium and 2 low findings. The high one: the new is_volume_operation attribute is read unconditionally on every execute, but the kernel floor is still ^1.4.0, so released wheels would break all kernel queries. The medium one: any kernel error with an HTTP status is turned into a generic staging OperationalError. Follow-up already noted in the PR: Windows and installed released-package validation are still open.

Other findings

  • ⚪ Nit — The new ordering (backend close_command first, then _kernel_handle.close()) now applies to every kernel result set, not only Volume ones. For async results, close_command closes the retained owning handle and the parent Statement (client.py ~800-820) while the result stream taken from them is still open. Before this change the stream was closed first. Any error from closing the stream afterwards is logged and swallowed, but this changes the teardown order for all async results to work around a lock that only Volume transfers hold. Consider cancelling only the Volume canceller first and keeping the old order for everything else.
  • ⚪ Nit — Several new cancellation paths have no unit tests: close_session now cancels all in-flight sync cancellers and retained Volume cancellers, and close_command cancels a pending Volume canceller (client.py:784-790). The only Volume backend test covers cancel_command and finish_volume_operation. test_volume_close_signals_backend_before_native_lock uses a mocked backend, so it doesn't exercise the real close_command logic. Add tests that (a) close_command on a registered Volume id calls cancel() and removes the entry, and (b) close_session cancels and clears both maps, even when cancel() raises.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Nit

Needs changes: 1 high and 1 low concern. The kernel attribute this change relies on is read on every query, but the dependency floor still allows wheels that lack it. The Volume completion, cancel and error-mapping flow otherwise looks consistent with Thrift.

Other findings

  • ⚪ Nit — The two ProgrammingError message literals exceed the 100-character limit in CONTRIBUTING.md. Black doesn't split strings, so split them into adjacent literals. (Found by Claude Opus 5.5 · confirmed by the judge)

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Looks good, no blocking defects in the diff. As the PR notes, the change reads is_volume_operation and VolumeCompletion on every kernel execute, so the packaging floor and lock must select the compatible kernel release before merge. Nit: the two error-message literals in result_set.py go past the 100-char line limit.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Looks good, no blocking issues found in the connector-side wiring. Merge is still blocked on the dependency gate: the kernel package floor and lockfile do not yet select a release with the Volume APIs. I could not check against the kernel source whether metadata result handles expose is_volume_operation.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Medium

Needs a dependency gate before merge: 1 high concern. The completion, cancellation and error-mapping logic looks sound and has tests. But the new handle attributes are read on every query, and the package floor still allows kernel wheels that don't have them.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Comment thread tests/e2e/test_kernel_backend.py Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Needs changes: 1 high concern. The completion, cancellation and error-mapping logic looks sound and has tests. But the new kernel attributes are read unconditionally, while the dependency floor still allows kernel wheels that lack them.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Mostly solid. One medium concern: the new kernel attributes are accessed on every result set, but the kernel dependency floor has not been raised yet. The cancel/finish bookkeeping and the error mapping look consistent, and both are covered by unit tests.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Mostly solid: one medium concern. Volume completion, cancellation and error mapping look consistent with Thrift, but the new native attributes are read unconditionally while the kernel dependency floor still allows older wheels.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

One high-severity issue: the new native Volume API is called unconditionally, but the kernel dependency floor was not raised. Apart from that, the completion, cancel and error-mapping paths look consistent and have tests.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

One high concern: this would break every kernel query on the currently released kernel wheel. The staging flow, the canceller lifecycle and the error mapping otherwise look correct and are covered by tests. The PR already notes that the dependency floor is a pending gate.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Looks good, with one merge blocker the PR already names. Sync execute and every KernelResultSet now read is_volume_operation without a fallback, so any query fails on kernel wheels the current floor still allows. Bump the packaging floor and lock to the release that has the Volume API before merging.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

One high concern: the kernel floor isn't bumped. With a supported 1.5.x wheel, every kernel statement breaks, not only Volume ones. The rest of the cancellation, completion and error-mapping wiring looks consistent and has tests.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Needs changes: 1 high concern. The Volume completion and cancel wiring looks sound. However, the unconditional reads of the new kernel attribute break every kernel query on wheels the current ^1.5.0 floor still allows.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Nit

Needs changes — 1 high, 1 low. The Volume wiring, canceller lifetime and error mapping look right, but this can't merge until the kernel dependency floor is raised. Doc nit: the client.py comment says a positive _socket_timeout is the idle limit for Volume transfers, while CONNECTION_PARAMETERS.md says a redirected PUT resend has no idle bound.

Other findings

  • ⚪ Nit — The VOLUME_PATH_NOT_ALLOWED message literals in result_set.py are well over the repo's 100-character line limit. Split them into implicitly concatenated string pieces. (Found by Claude Opus 5.5 · confirmed by the judge)

results_queue=None,
description=description_from_arrow_schema(schema),
is_staging_operation=False,
is_staging_operation=kernel_handle.is_volume_operation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — KernelResultSet.__init__ and execute_command now read is_volume_operation unconditionally. pyproject allows ^1.5.0 and poetry.lock pins 1.5.0, and only KERNEL_REV (a CI source) changed. Wheels without the Volume API would raise AttributeError on every query. Raise the kernel floor in pyproject, regenerate the lock, and release the kernel wheel before merging.

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of the release gate in #1057 (comment). Kernel 1.5.0 lacks the Volume API, so the floor in pyproject.toml and the lockfile move to the first kernel release that includes databricks-sql-kernel#512 and databricks-sql-kernel#513 before merge, as the Kernel version section of the description states.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at eec0627: pyproject.toml:73 still allows ^1.5.0 (no Volume API), and the lock still pins 1.5.0. Keep this open until both change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: pyproject.toml:73 still allows ^1.5.0; needs a released kernel floor and an updated lock.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 2 Low

Looks reasonable: 2 low concerns. Merge gate: KernelResultSet now reads kernel_handle.is_volume_operation unconditionally, so every query breaks on older kernel wheels until the dependency floor and lock are updated. Nit: the ProgrammingError message lines in result_set.py go over the 100-char limit.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

results_queue=None,
description=description_from_arrow_schema(schema),
is_staging_operation=False,
is_staging_operation=kernel_handle.is_volume_operation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — KernelResultSet now reads kernel_handle.is_volume_operation for every result, but pyproject still allows kernel ^1.5.0, which lacks the Volume APIs. Ordinary SELECTs could fail with an installed release. Raise the floor and lock to the kernel release that ships the Volume API, and test a clean install.

🔀 Found by GPT-6.1 Sol · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of the release gate in #1057 (comment). Kernel 1.5.0 lacks the Volume API, so the floor in pyproject.toml and the lockfile move to the first kernel release that includes databricks-sql-kernel#512 and databricks-sql-kernel#513 before merge, as the Kernel version section of the description states.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at eec0627: pyproject.toml:73 still allows kernel ^1.5.0, which lacks the Volume API. The floor and lock haven't moved yet.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: pyproject.toml:73 still allows kernel ^1.5.0. Keeping this open until a kernel release includes the Volume API.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Needs changes: 1 high concern. The Volume completion, cancellation and error mapping look sound, but the new kernel attributes are required on every query path while the dependency floor still admits kernel 1.5.0, which lacks them.

pass
executed = stmt.execute()
command_id = CommandId.from_sea_statement_id(executed.statement_id)
if executed.is_volume_operation:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — The code reads executed.is_volume_operation and kernel_handle.is_volume_operation unconditionally, but pyproject.toml still allows kernel ^1.5.0, which has no Volume bindings. With that wheel installed, every kernel-path query would fail with AttributeError. Raise the kernel floor to the release that has the Volume API and update the lockfile. Alternatively, read the attribute with getattr and a False default.

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of the release gate in #1057 (comment). Kernel 1.5.0 lacks the Volume API, so the floor in pyproject.toml and the lockfile move to the first kernel release that includes databricks-sql-kernel#512 and databricks-sql-kernel#513 before merge, as the Kernel version section of the description states.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at eec0627: the pyproject.toml floor is still ^1.5.0 and the lockfile is unchanged. Keep this open until the kernel floor is raised.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: pyproject.toml:73 still pins kernel ^1.5.0. This needs a released kernel with #520/#521 and an updated lockfile.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Needs changes: 1 high concern. The new volume attribute is read on every kernel result, but the dependency floor is still ^1.5.0. Nit: the client.py _socket_timeout comment says None/0 sets no Volume idle limit, while CONNECTION_PARAMETERS.md says it keeps a 15-minute default.

pass
executed = stmt.execute()
command_id = CommandId.from_sea_statement_id(executed.statement_id)
if executed.is_volume_operation:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — The code reads is_volume_operation unconditionally on every kernel result. pyproject.toml still allows ^1.5.0 and poetry.lock pins 1.5.0, which this PR's own changelog/KERNEL_REV bump implies lacks the attribute. Ordinary queries would then raise AttributeError. Raise the dependency floor and regenerate the lock, or read the attribute with getattr(..., False).

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: client.py:651 reads is_volume_operation unconditionally; the kernel floor and lock still need to move to a release that includes it.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Low

Looks good — 1 low concern. Merge is still blocked on the dependency gate the PR already notes: KernelResultSet reads is_volume_operation on every handle, so with the current floor an older kernel wheel would break every query.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

results_queue=None,
description=description_from_arrow_schema(schema),
is_staging_operation=False,
is_staging_operation=kernel_handle.is_volume_operation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — KernelResultSet.__init__ reads kernel_handle.is_volume_operation for every result, and execute_command reads executed.is_volume_operation too. The lock file pins databricks-sql-kernel 1.5.0 and pyproject allows ^1.5.0, so a released wheel without the Volume API would break ordinary queries. Only KERNEL_REV was bumped, so installed users aren't covered. Raise the dependency floor and lock to the release that has the Volume API, or read the attribute defensively with getattr.

🔀 Found by GPT-6.1 Sol · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: result_set.py:87 still reads is_volume_operation directly, and the floor and lock remain at 1.5.0 until the kernel release.

Comment thread src/databricks/sql/client.py Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Low

Looks good, with 1 low concern: a code comment and the docs disagree on the default Volume transfer idle limit. Not yet mergeable: is_volume_operation is read unconditionally, so current kernel wheels break every query until the dependency floor and lock select the release with databricks/databricks-sql-kernel#513.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Comment thread src/databricks/sql/client.py Resolved
pass
executed = stmt.execute()
command_id = CommandId.from_sea_statement_id(executed.statement_id)
if executed.is_volume_operation:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — KernelResultSet reads kernel_handle.is_volume_operation for every statement, and client.py reads executed.is_volume_operation. pyproject allows ^1.5.0 and poetry.lock pins 1.5.0, which likely predates these APIs, so ordinary queries could fail with AttributeError. Raise the kernel dependency floor to the release that has the Volume APIs and regenerate the lockfile.

🔀 Found by GPT-6.1 Sol · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: the pyproject floor and lock still need to move to a released kernel with the Volume APIs before merge.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 2 Low

Needs changes: 1 high, 1 low. The Volume completion and cancel wiring looks correct, but the code assumes a kernel API that the current dependency floor (1.5.0) doesn't provide.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Comment thread tests/e2e/test_kernel_backend.py Resolved
pass
executed = stmt.execute()
command_id = CommandId.from_sea_statement_id(executed.statement_id)
if executed.is_volume_operation:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — The code now reads is_volume_operation and calls complete_volume_operation on every kernel result, but the dependency floor is still ^1.5.0 while KERNEL_REV moved to a new kernel. A released 1.5.0 wheel may lack these attributes, so ordinary queries could raise AttributeError. Bump the floor and lock to a release that has the Volume API, or read the attribute defensively.

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on the kernel release, so I'm leaving this open: is_volume_operation and complete_volume_operation need databricks/databricks-sql-kernel#520 and #521 merged and a released databricks-sql-kernel that includes them, and the pyproject.toml floor and lock move to that release before this merges. KERNEL_REV already pins the #521 head for source builds.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at 3aa6fca: client.py:651 reads is_volume_operation with no fallback, and the pyproject floor/lock still haven't moved past ^1.5.0.

Comment thread src/databricks/sql/client.py Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Low

Mostly sound, with 1 medium and 1 low concern. The cancel and close wiring for sync and async Volume transfers holds up. The main risk is that every kernel query now reads is_volume_operation, which some wheels allowed by the current kernel floor (^1.5.0) don't have.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Low

Changes requested: 1 high, 1 low. The cancel and cleanup wiring for Volume transfers looks consistent. The blocker is the unconditional is_volume_operation reads, which break every kernel query against the current ^1.5.0 kernel floor.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Low

Needs a dependency gate before merge — 1 medium, 1 low. The native Volume completion wiring and error mapping look sound, and the tests cover the main paths well.

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Low

Looks good, with one low concern. The canceller lifecycle, the error mapping and the native completion routing check out against the sync, async and close paths. The kernel dependency floor and lockfile are not updated yet; as the PR description says, that must happen before merge.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

Comment thread CHANGELOG.md Resolved
The kernel backend sets the Volume options on every statement before it
runs, so the kernel transfers the file of a PUT, GET or REMOVE inside
execute. staging_allowed_local_path becomes the allowed directories (an
empty list when unset, which still allows a REMOVE, as on Thrift), and
execute(input_stream=...) supplies the bytes for PUT '__input_stream__'.
A Volume result returns no rows, and local path and storage errors raise
the exceptions the Thrift backend raises. Removes the guard that refused
staging statements on the kernel backend.

Pins KERNEL_REV to databricks-sql-kernel#521.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High · 1 Medium

Mostly sound, with 1 medium concern. set_volume_options and is_volume_operation are used without a capability check, so this needs the kernel floor/lock bump the PR already lists as a merge gate. Until then, every execute fails on kernel 1.5.0.

This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.

bind_tspark_params(stmt, parameters)
# The kernel then runs the file transfer of a Volume PUT, GET or
# REMOVE inside execute.
stmt.set_volume_options(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — The kernel client now calls stmt.set_volume_options and reads is_volume_operation on every statement. pyproject still allows kernel ^1.5.0, which lacks those APIs, so every execute can fail with AttributeError. Raise the dependency floor and the lock to the kernel release that has the Volume API.

🔀 Found by GPT-6.1 Sol · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same release gate as #1057 (comment). databricks/databricks-sql-kernel#520 and #521 are merged (KERNEL_REV now pins d18b044b), but the floor and lock in pyproject.toml and poetry.lock can only move once a kernel release ships, so this stays open until then.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at c3cce98: the kernel ^1.5.0 floor and lock remain unchanged, so this stays release-gated until a kernel release with the Volume API ships.

Pin the kernel to d18b044b, the databricks-sql-kernel main commit that
merged #521 (Volume bindings, on #520). The bindings tree matches the
commit this PR pinned before, plus #511 (configurable Arrow LZ4
compression) from kernel main.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 2 High · 1 Low

Needs changes: 2 high, 1 low. The new kernel calls (set_volume_options, is_volume_operation) run unconditionally while the dependency floor is still ^1.5.0. On any released wheel, every query would fail.

bind_tspark_params(stmt, parameters)
# The kernel then runs the file transfer of a Volume PUT, GET or
# REMOVE inside execute.
stmt.set_volume_options(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — set_volume_options is called on every kernel statement, but pyproject.toml still allows ^1.5.0, which lacks it. Every execute(), including SELECT, would fail on a released wheel. Gate the call on the method existing, or raise the floor when the supporting kernel ships.

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same release gate as #1057 (comment). databricks/databricks-sql-kernel#520 and #521 are merged (KERNEL_REV now pins d18b044b), but the floor and lock in pyproject.toml and poetry.lock can only move once a kernel release ships, so this stays open until then.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at c3cce98: client.py:669 calls set_volume_options unconditionally, and the kernel floor still allows wheels that lack it.

# stays O(1) instead of walking the deque.
self._buffered_count: int = 0
self._exhausted: bool = False
if kernel_handle.is_volume_operation:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — kernel_handle.is_volume_operation is read unconditionally in KernelResultSet.__init__. A 1.5.0 kernel handle lacks it, so every result set raises AttributeError. Use getattr(kernel_handle, 'is_volume_operation', False) or raise the dependency floor.

🔀 Found by Claude Opus 5.5 · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same release gate as #1057 (comment). databricks/databricks-sql-kernel#520 and #521 are merged (KERNEL_REV now pins d18b044b), but the floor and lock in pyproject.toml and poetry.lock can only move once a kernel release ships, so this stays open until then.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at c3cce98: result_set.py:103 reads is_volume_operation without a guard, and the kernel floor hasn't been raised. Waiting on the kernel release.

aakash-saravanan-db and others added 2 commits December 3, 2026 22:37
The kernel backend sets the staging paths on every statement, so a
pathlib.Path value failed every query with a TypeError, while Thrift only
rejects it for a PUT or GET. A path or a list of paths is now converted
with os.fspath. Any other value allows no local paths, so a PUT or GET
reports the same error as Thrift and other statements still run.

Also tests the Volume error mapping on the async result path.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).

Verdict: 1 High

Needs changes: 1 high concern. The Volume wiring and the Thrift-matching error mapping look correct and are tested. However, the change calls kernel APIs unconditionally, and the dependency floor still allows a kernel release that lacks them, so ordinary queries break.

bind_tspark_params(stmt, parameters)
# The kernel then runs the file transfer of a Volume PUT, GET or
# REMOVE inside execute.
stmt.set_volume_options(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — set_volume_options is called on every statement, and KernelResultSet reads kernel_handle.is_volume_operation on every result. Neither is gated, and pyproject.toml still allows kernel ^1.5.0. If 1.5.0 lacks these APIs, every execute() fails. Gate both with hasattr and keep rejecting PUT/GET/REMOVE on old wheels, or raise the kernel floor in pyproject.toml and poetry.lock to a release that has them.

🔀 Found by both reviewers · confirmed by the judge

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same release gate as #1057 (comment). databricks/databricks-sql-kernel#520 and #521 are merged (KERNEL_REV now pins d18b044b), but the floor and lock in pyproject.toml and poetry.lock can only move once a kernel release ships, so this stays open until then.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open at c3cce98: set_volume_options at client.py:669 isn't gated, and the kernel floor in pyproject.toml/poetry.lock is still ^1.5.0.

This branch was previously deployed

1 inactive deployment
azure-prod — c3cce984 Deployed Dec 3, 2026 by oss-reviewer-bot[bot] via followup #2886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant