Skip to content

Commit bde5cf8

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

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/databricks/sql/result_set.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ def _fetchone_buffered(
215215
"""
216216
if self._row_buffer_count() == 0:
217217
raw = fetch_raw(max(min(self.arraysize, _FETCHONE_BUFFER_MAX_ROWS), 1))
218+
# If convert() raises, this batch is dropped on purpose: the queue has
219+
# already moved past it, and _next_row_index (advanced by fetch_raw)
220+
# still equals the queue position. Rolling the index back would make it
221+
# lag the queue and break Thrift's expected_row_start_offset check on
222+
# the next fetch, and retrying convert() on the same data would just
223+
# fail again.
218224
rows = convert(raw)
219225
if not rows:
220226
return None

0 commit comments

Comments
 (0)