$ the-wire · showcase
Firestore learns BSON, python-genai reaps dead event loops
By RepoJournal · Filed · About Google · Composed from the cited sources · methodology
Firestore's Python SDK picks up Mongo-style BSON support across write, read, and query ordering, while python-genai fixes a per-request session leak and JAX removes custom_remat in favor of defremat.
fix: reap aiohttp sessions and auth locks belonging to closed event loops googleapis/python-genai
BaseApiClient cached its aiohttp session and asyncio auth lock per event loop but never dropped an entry when that loop closed, so a server calling asyncio.run() per request kept one session, connector, and socket set for every request it served. Entries whose loop is closed are now dropped on the next access, bounding both caches by the number of live loops.
feat(firestore): add BSON read deserialization support googleapis/google-cloud-python
With decode_bson=True, document fields carrying BSON wire map structures such as {"__oid__": "507f191e810c19729de860ea"} deserialize into BSONObjectId, BSONDecimal128, BSONTimestamp, BSONRegex, BSONBinary, BSONInt32, BSONMinKey, and BSONMaxKey instead of raw maps. It is opt-in, so the default decode path is unchanged.
[remat3] replace custom_remat with custom_vjp.defremat and custom_gradient(remat=True) google/jax
Under jax_remat3 and jax_custom_vjp3, custom_vjp(f).defremat(fwd, rem, bwd) takes over rematerialization customization that jax.custom_remat used to handle, covering the fwd, rem, and bwd computations generated under vjp-of-remat. The separate CustomRemat primitive and jax.custom_remat are removed, and unless defvjp is also called, the defremat rules define the VJP too.
feat(firestore): add BSON cross-type query ordering support googleapis/google-cloud-python
BSONMinKey, BSONMaxKey, BSONObjectId, BSONInt32, BSONDecimal128, BSONBinary, BSONRegex, and BSONTimestamp get cross-type query ordering aligned with backend specs, via a _BSON_KEY_TO_TYPE_ORDER mapping in order.py for O(1) wire-key resolution and consolidated numeric comparison in Order.compare_numbers.
feat(firestore): add PyMongo duck-typing serialization support googleapis/google-cloud-python
encode_value() now duck-types native PyMongo and third-party BSON objects (bson.ObjectId, bson.Decimal128, bson.Regex, bson.Timestamp, bson.MinKey, bson.MaxKey), so MongoDB migrations can write those values to Firestore directly rather than converting types by hand to avoid TypeError. The author flags the work as optional and open to discussion offline.
chore(gapic-generator): update dependencies googleapis/google-cloud-python
On the generator side, requirements.txt moved, the showcase integration presubmit came back, and async stream tests now align their trailing metadata assertions with gRPC >= 1.75.0, where grpc.aio.Metadata enforces str to List[str] mapping semantics rather than accepting list-of-tuples.