mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-30 11:12:58 +00:00
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.