Skip to content

PYTHON-6024 Consolidate all non-IO code in _AsyncClientBulk/_AsyncBul… - #3087

Merged
sleepyStick merged 1 commit into
mongodb:mainfrom
sleepyStick:PYTHON-6024
Oct 1, 2026
Merged

sleepyStick merged 1 commit into
mongodb:mainfrom
sleepyStick:PYTHON-6024

Conversation

@sleepyStick

Copy link
Copy Markdown
Contributor

…k into _AgnosticClientBulkBase/_AgnosticBulkBase

PYTHON-6024

Changes in this PR

Test Plan

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

…k into _AgnosticClientBulkBase/_AgnosticBulkBase
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sleepyStick
sleepyStick marked this pull request as ready for review October 1, 2026 19:58
@sleepyStick
sleepyStick requested a review from a team as a code owner October 1, 2026 19:58
@sleepyStick
sleepyStick requested review from blink1073 and a balanced review from Copilot October 1, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pymongo/typings.py

__all__ = [
"_Address",
"_AgnosticMongoClient",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this removed to prevent an import cycle?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, it just caught my eye. 😄

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sleepyStick
sleepyStick merged commit 1bb24c9 into mongodb:main Oct 1, 2026
92 of 94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants