Repository navigation
PYTHON-6024 Consolidate all non-IO code in _AsyncClientBulk/_AsyncBul… - #3087
Conversation
…k into _AgnosticClientBulkBase/_AgnosticBulkBase
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The refactor preserves existing behavior, keeps I/O-specific code separated, and introduces no identified regressions.
Review effort: Balanced
Findings: None
What changed in this PR
Consolidates duplicated synchronous and asynchronous bulk-write logic into shared agnostic base classes.
Changes:
- Adds shared bases for collection-level and client-level bulk writes.
- Retains I/O-specific execution in sync/async subclasses.
- Updates shared typing imports and exports.
| File | Description |
|---|---|
pymongo/_client_bulk_shared.py |
Adds the client bulk base implementation. |
pymongo/bulk_shared.py |
Adds the collection bulk base implementation. |
pymongo/asynchronous/client_bulk.py |
Inherits shared client bulk behavior. |
pymongo/asynchronous/bulk.py |
Inherits shared collection bulk behavior. |
pymongo/synchronous/client_bulk.py |
Mirrors the async client bulk refactor. |
pymongo/synchronous/bulk.py |
Mirrors the async collection bulk refactor. |
pymongo/typings.py |
Adjusts internal type exports. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| __all__ = [ | ||
| "_Address", | ||
| "_AgnosticMongoClient", |
There was a problem hiding this comment.
was this removed to prevent an import cycle?
There was a problem hiding this comment.
no -- it irked me that all the other _Agnostic* weren't being exported and i realized it wasn't needed lol
I can re-add it if you'd like?
There was a problem hiding this comment.
Makes sense, it just caught my eye. 😄
…k into _AgnosticClientBulkBase/_AgnosticBulkBase
PYTHON-6024
Changes in this PR
Test Plan
Checklist
Checklist for Author
Checklist for Reviewer