fix(python): close SQLite connections in BatchUDFCheckpoint#5733
Merged
wjones127 merged 1 commit intolance-format:mainfrom Jan 16, 2026
Merged
fix(python): close SQLite connections in BatchUDFCheckpoint#5733wjones127 merged 1 commit intolance-format:mainfrom
wjones127 merged 1 commit intolance-format:mainfrom
Conversation
Contributor
Code ReviewOverall: Clean fix for the Windows CI issue. Using context managers to ensure SQLite connections are properly closed is the right approach. P0/P1 Issues: None foundThe change correctly addresses the file lock issue on Windows by ensuring connections are closed before Minor note (not blocking)The
If you wanted to be extra explicit, you could use: conn = sqlite3.connect(path)
try:
# ... operations ...
conn.commit()
finally:
conn.close()But the current approach should work correctly and is more concise. LGTM ✓ |
SQLite connections were not being properly closed, causing file lock issues on Windows. The cleanup() method could not delete the checkpoint file because connections were still holding handles. The sqlite3 context manager only handles transactions (commit/rollback), not connection closing. Using contextlib.closing() ensures connections are actually closed when exiting the with block. Fixes lance-format#5732 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
e7c987c to
ceb0f94
Compare
westonpace
approved these changes
Jan 16, 2026
Member
westonpace
left a comment
There was a problem hiding this comment.
Nice work, thanks for helping with the CI 🎉
jackye1995
pushed a commit
to jackye1995/lance
that referenced
this pull request
Jan 21, 2026
…rmat#5733) ## Summary - Fix Windows CI failure by properly closing SQLite connections using context managers - Connections in `BatchUDFCheckpoint` were not being explicitly closed, causing file lock issues when `cleanup()` tried to delete the checkpoint file Fixes lance-format#5732 ## Test plan - [x] Existing test `test_add_columns_udf_caching` passes locally - [x] Windows CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
vivek-bharathan
pushed a commit
to vivek-bharathan/lance
that referenced
this pull request
Feb 2, 2026
…rmat#5733) ## Summary - Fix Windows CI failure by properly closing SQLite connections using context managers - Connections in `BatchUDFCheckpoint` were not being explicitly closed, causing file lock issues when `cleanup()` tried to delete the checkpoint file Fixes lance-format#5732 ## Test plan - [x] Existing test `test_add_columns_udf_caching` passes locally - [x] Windows CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BatchUDFCheckpointwere not being explicitly closed, causing file lock issues whencleanup()tried to delete the checkpoint fileFixes #5732
Test plan
test_add_columns_udf_cachingpasses locally🤖 Generated with Claude Code