Repository navigation
fix(bigtable): encode str qualifier in DeleteRangeFromColumn and allow -2**63 in int mutations - #18881
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates integer boundary checks across mutations and read-modify-write rules to correctly validate 64-bit signed integers using both minimum and maximum bounds, and adds support for string qualifiers in DeleteRangeFromColumn. The review feedback correctly points out that several error messages incorrectly state the upper limit as 263 instead of the exclusive 263 - 1, and suggests updating these messages to prevent user confusion.
mutianf
force-pushed
the
fix-mutation-validation
branch
from
October 28, 2026 19:30
e251888 to
a8364ea
Compare
…w -2**63 in int mutations
…lumns, and fix wrapper algebra
mutianf
force-pushed
the
fix-mutation-validation
branch
from
October 30, 2026 02:49
a8364ea to
4aed324
Compare
daniel-sanche
approved these changes
Oct 30, 2026
daniel-sanche
pushed a commit
that referenced
this pull request
Oct 30, 2026
…w -2**63 in int mutations (#18881) ## Summary - **`DeleteRangeFromColumn` qualifier validation and encoding**: `DeleteRangeFromColumn` did not encode `str` qualifiers to `bytes` in `__post_init__`, causing `proto-plus` to treat string qualifiers as base64 during `_to_pb()` serialization and either silently decode into the wrong column bytes or fail with `binascii.Error`. `__post_init__` now encodes `str` qualifiers to UTF-8 `bytes` and raises `TypeError` for non-`bytes`/`str` inputs, matching `SetCell` and `AddToCell`. - **Allow `-2**63` (`INT64_MIN`) in integer mutations and increment rules**: `SetCell`, `AddToCell`, and `IncrementRule` checked `abs(val) > (1 << 63) - 1`, which rejected the valid two's-complement minimum 64-bit signed integer `-2**63` (`-9223372036854775808`) with `ValueError`. Replaced the `abs()` check with `_MIN_INCREMENT_VALUE <= val <= _MAX_INCREMENT_VALUE`. ## Test plan - [x] Added unit tests in `tests/unit/data/test_mutations.py` and `tests/unit/data/test_read_modify_write_rules.py` covering `-2**63` and `2**63 - 1` bounds and `DeleteRangeFromColumn` `str` / invalid qualifier handling.
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
DeleteRangeFromColumnqualifier validation and encoding:DeleteRangeFromColumndid not encodestrqualifiers tobytesin__post_init__, causingproto-plusto treat string qualifiers as base64 during_to_pb()serialization and either silently decode into the wrong column bytes or fail withbinascii.Error.__post_init__now encodesstrqualifiers to UTF-8bytesand raisesTypeErrorfor non-bytes/strinputs, matchingSetCellandAddToCell.-2**63(INT64_MIN) in integer mutations and increment rules:SetCell,AddToCell, andIncrementRulecheckedabs(val) > (1 << 63) - 1, which rejected the valid two's-complement minimum 64-bit signed integer-2**63(-9223372036854775808) withValueError. Replaced theabs()check with_MIN_INCREMENT_VALUE <= val <= _MAX_INCREMENT_VALUE.Test plan
tests/unit/data/test_mutations.pyandtests/unit/data/test_read_modify_write_rules.pycovering-2**63and2**63 - 1bounds andDeleteRangeFromColumnstr/ invalid qualifier handling.