Repository navigation
fix: validate datatype integer bounds in core type registry (#1170) - #1171
Closed
zerafachris wants to merge 1 commit into
Closed
zerafachris wants to merge 1 commit into
zerafachris wants to merge 1 commit into
Conversation
zerafachris
force-pushed
the
fix/datetime64-integer-bounds-1170
branch
2 times, most recently
from
November 10, 2026 04:50
09a712d to
39c54f7
Compare
zerafachris
force-pushed
the
fix/datetime64-integer-bounds-1170
branch
from
November 10, 2026 04:50
39c54f7 to
1fa3132
Compare
Contributor
|
Thank you for this but I are closing it along with along with the #1170 issue. The reasons are listed there. The review also found these problems:
|
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.
Fixes #1170
Root Cause
ClickHouseType.build()andDecimal.build()constructed datatype instances without checkingcls._type_args.integer_boundsor argument counts. As a result,get_from_name()accepted out-of-range or malformed arguments such asDateTime64(10)orDateTime64(-1), producing broken type instances (for examplenano_divisor == 0and integer overflow during inserts) instead of failing at parse time.Changes
ClickHouseType._validate_type_def()to check argument counts and positional_TypeArgs.integer_boundsbefore building datatype instances._validate_type_def()inClickHouseType.build()andDecimal.build()(plusscale <= prec).tests/unit_tests/test_chtypes.pycovering out-of-range and malformed arguments forDateTime64,Time64,FixedString, andDecimal*.Verification
pytest -o addopts="" tests/unit_tests/test_chtypes.py tests/unit_tests/test_driver/test_parser.py tests/unit_tests/test_binary_value.py tests/unit_tests/test_dynamic.py(342 passed)Prepared with AI assistance (OpenCode), reviewed for correctness before submission.