Conversation
ohmayr
added this pull request to stack #18386
September 16, 2026 08:44
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the BSONRegex class to represent BSON Regular Expression containers for Firestore, along with corresponding unit and system tests. The new class is integrated into the package's public API and supports pattern validation, option flag normalization (including conversion from Python re flags), serialization, and comparison operations. There are no review comments, and I have no feedback to provide.
ohmayr
marked this pull request as ready for review
September 16, 2026 18:50
ohmayr
force-pushed
the
bson-pr1f-regex
branch
from
September 16, 2026 20:02
67d6ca3 to
b93150c
Compare
ohmayr
force-pushed
the
bson-pr1f-regex
branch
from
September 16, 2026 20:43
b93150c to
ed7f12b
Compare
ohmayr
force-pushed
the
bson-pr1f-regex
branch
from
September 16, 2026 20:57
ed7f12b to
ce477c3
Compare
ohmayr
force-pushed
the
bson-pr1f-regex
branch
from
September 16, 2026 21:58
ce477c3 to
c3d09f8
Compare
ohmayr
force-pushed
the
bson-pr1f-regex
branch
from
September 16, 2026 22:11
c3d09f8 to
c488151
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.
Adds the
BSONRegexdata type to support BSON regular expression field serialization in Google Cloud Firestore according to the official Firestore BSON specification.BSONRegexContainer Class: Introducesgoogle.cloud.firestore_v1.bson.BSONRegexto encapsulate regex patterns (pattern: str) and option flags (options: str | re.RegexFlag | int).reflag integers (re.IGNORECASE | re.MULTILINE) into sorted, unique BSON option flag strings (e.g.,"im")._to_map_value()convertingBSONRegexinto the reserved{"__regex__": {"pattern": pattern, "options": options}}wire map representation.google.cloud.firestore_v1andgoogle.cloud.firestore).Fixes: b/562163604