Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the BSONBinary class to represent BSON binary data containers with subtypes for Firestore. It includes integration with the client post-processing configuration, exports the class in the package's public interfaces, and adds comprehensive unit and system tests to verify its behavior and serialization. I have no feedback to provide as there are no review comments.
ohmayr
added this pull request to stack #18386
September 16, 2026 01:10
ohmayr
marked this pull request as ready for review
September 16, 2026 01:10
ohmayr
force-pushed
the
bson-pr1d-binary
branch
from
September 16, 2026 02:01
10eadcd to
bf0ffd9
Compare
ohmayr
force-pushed
the
bson-pr1d-binary
branch
from
September 16, 2026 02:09
bf0ffd9 to
2314d3b
Compare
ohmayr
force-pushed
the
bson-pr1d-binary
branch
from
September 16, 2026 02:25
2314d3b to
53dbc8c
Compare
ohmayr
force-pushed
the
bson-pr1d-binary
branch
2 times, most recently
from
September 16, 2026 02:36
71cb746 to
9962001
Compare
ohmayr
force-pushed
the
bson-pr1d-binary
branch
from
September 16, 2026 07:43
9962001 to
a09cb4f
Compare
ohmayr
force-pushed
the
bson-pr1d-binary
branch
from
September 16, 2026 08:07
a09cb4f to
1ebc983
Compare
ohmayr
force-pushed
the
bson-pr1d-binary
branch
from
September 16, 2026 08:25
1ebc983 to
ca0e59c
Compare
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.
This PR adds support for BSONBinary in the Firestore Python SDK. BSONBinary` allows database applications to store subtyped binary data payloads (such as UUIDs, MD5 hashes, or custom binary subtypes) in Firestore documents.
BSONBinaryContainer Class: ImplementsBSONBinary(_BSONType)ingoogle.cloud.firestore_v1.bson, wrapping binary payloads (bytesorbytearray) and a 1-byte BSON subtype tag (0)._to_map_value):subtype == 0(generic binary): Serializes directly as raw bytes (bytes_value).subtype != 0(subtyped binary): Serializes as{"__binary__": bytes([subtype]) + data}(map_value).TypeErrorfor non-binary payloads or non-integer / boolean subtype tags.ValueErrorifsubtypeis outside the 1-byte range (BSONBinaryingoogle.cloud.firestoreandgoogle.cloud.firestore_v1, and updated.librarian/generator-input/client-post-processing/firestore-integration.yaml.tests/unit/v1/test_bson.pyand verified live sync and async write operations against Firestore Enterprise DB (enterprise-db-native-2).Fixes b/562182261 🦕