Repository navigation
Skip ip_address() for address objects in IPv6 inserts - #1166
Merged
joe-clickhouse merged 3 commits intoNov 10, 2026
Merged
Conversation
patrick-immometrica
marked this pull request as ready for review
November 9, 2026 12:06
Signed-off-by: Joe Spadola <joe.spadola@clickhouse.com>
chernser
approved these changes
Nov 10, 2026
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
IPv6._write_column_binarycallsip_address(value)for every row, even whenvalueis already anIPv6Address/IPv4Address. For an address object that's expensive: the constructors don't special-case address instances, so the object gets stringified and parsed again, and for anIPv6Addressonly after theIPv4Addressattempt has raised.This uses the object as is when it's already an address and only calls
ip_address()for everything else (str, int, bytes). Output is byte-identical.Nullable(IPv6), 200k rows, Python 3.14, Cython build:IPv6AddressIPv4AddressChecklist
test_network.pytests (address objects, IPv4-mapped, None, invalid strings)