Skip to content

Commit 62fb86e

Browse files
ai: apply changes for #1007 (1 review thread)
Addresses: - #4419399913 at src/databricks/sql/result_set.py:395 Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
1 parent 238dd78 commit 62fb86e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/databricks/sql/result_set.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,15 @@ def _fetchone_buffered(
390390
# as before batching, only the row(s) that fail to convert are
391391
# lost: each failing row is parked as a _FailedRow and re-raises
392392
# its own error when it is reached.
393+
# Why not just drop the batch and re-raise (as fetchmany does)?
394+
# fetchone() used to convert one row at a time, so callers that
395+
# catch a conversion error and keep iterating lost only that row.
396+
# Dropping the whole refill would silently lose up to
397+
# _FETCHONE_BUFFER_MAX_ROWS good rows per bad one, a behaviour
398+
# change hidden behind a perf fix. Bisection keeps the old
399+
# semantics; its ~2n-conversion worst case is bounded by the ramp
400+
# reset below, and _FailedRow tracebacks are freed as they are
401+
# consumed (or with the buffer).
393402
# Warn once per result set; later failing batches (e.g. a column
394403
# type that fails in every row) log at DEBUG to avoid a WARNING
395404
# per refill for callers that catch and keep fetching.

0 commit comments

Comments
 (0)