Files
turso/serverless/python/turso_serverless
Pekka Enberg 3878969b8d serverless/python: split batch step building out of Connection.batch
Ruff fails CI with C901: `batch` scored 11 against the limit of 10. The
method was doing two jobs, and the step-building half re-tested
`begin_sql is not None` four separate times while threading an `offset`
through every index computation.

Move step building into `_build_batch_steps`, where the transactional and
non-transactional shapes each build their own list with concrete indices
instead of interleaving. No behavior change: the emitted steps, the index
of the first statement step, and the COMMIT index are identical to what
the old code produced.

Tests: `uvx ruff@0.5.4 check` passes; `pytest tests/test_serverless.py`
passes (the batch tests needing a live server stay skipped). Also diffed
the new helper against the pre-refactor step building for transactional
and non-transactional batches with positional, named, and no parameters —
identical output in every case.
2026-08-30 08:44:10 +03:00
..