Skip to content

PYTHON-2381 Remove "raw" field handling - #2808

Merged
aclark4life merged 2 commits into
mongodb:masterfrom
aclark4life:PYTHON-2381
May 21, 2026
Merged

aclark4life merged 2 commits into
mongodb:masterfrom
aclark4life:PYTHON-2381

Conversation

@aclark4life

@aclark4life aclark4life commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

PYTHON-2381

Changes in this PR

Remove handling of "raw" field in command errors

Test Plan

Remove testing of "raw" field in command errors

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?

@aclark4life
aclark4life requested a review from a team as a code owner May 20, 2026 17:27
@aclark4life
aclark4life requested review from NoahStapp and Copilot May 20, 2026 17:27

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov-commenter

codecov-commenter commented May 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread pymongo/helpers_shared.py
Comment on lines 242 to 244
details = response
# Mongos returns the error details in a 'raw' object
# for some errors.
if "raw" in response:
for shard in response["raw"].values():
# Grab the first non-empty raw error from a shard.
if shard.get("errmsg") and not shard.get("ok"):
details = shard
break

errmsg = details["errmsg"]
code = details.get("code")
@aclark4life
aclark4life merged commit e424168 into mongodb:master May 21, 2026
102 of 103 checks passed
@aclark4life
aclark4life deleted the PYTHON-2381 branch May 21, 2026 18:57
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.

4 participants