Repository navigation
Keep already-nullable columns nullable when transforming NOT NULL constraints - #959
Closed
chinh13eboi2luae-ui wants to merge 1 commit into
Closed
chinh13eboi2luae-ui wants to merge 1 commit into
chinh13eboi2luae-ui wants to merge 1 commit into
Conversation
Author
Owner
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.
Table.transform(not_null={"age": False})addsNOT NULLwhenageis already nullable. Existing NULL rows cause anIntegrityError, while other tables silently acquire a constraint.Use
set.discard()for an explicitFalseso removing an absent constraint is a no-op. The existing handling of true values and renamed columns continues through the same code path. A regression test verifies that an already-nullable column stays nullable.Fixes #944.
Validation
Tests ran on Windows using a local Docker Linux container with Python 3.12, SpatiaLite and the repository's development dependencies. Container networking was disabled.
9c66bafa52aecompleted with1512 passed, 1 skipped, 33 warnings in 8.93s.1513 passed, 1 skipped, 33 warnings in 8.97s.Docker check output
AI assistance
The patch and regression test were generated through an LLM gateway, then reviewed with Codex and verified using the Docker checks above.
Verification request
Please confirm that the original reproduction and the
--not-null-false ageCLI option preserve existing NULL values and leave the column nullable.📚 Documentation preview 📚: https://sqlite-utils--959.org.readthedocs.build/en/959/
GitHub Actions currently reports
action_requiredfor the test workflows. These workflows need maintainer approval to run for this contribution.