Skip to content

PYTHON-4660 Fix AttributeError when MongoClient.bulk_write batch fails with InvalidBSON #1792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

shruti-sridhar
Copy link
Contributor

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Forgot one thing, is it possible to add a test case for this? IIUC we need to make a batch fail with a non-PyMongoError

@shruti-sridhar
Copy link
Contributor Author

Forgot one thing, is it possible to add a test case for this? IIUC we need to make a batch fail with a non-PyMongoError

Do you know if there's a way to trigger a non-PyMongoError within a failpoint? I've tested that it works by manually causing a TypeError somewhere in the code for instance, but I'm not sure how to automatically trigger a non-PyMongoError.

@ShaneHarvey
Copy link
Member

No it's not possible with a failpoint. I believe it would have to be mocked.

@ShaneHarvey
Copy link
Member

Nice!

@shruti-sridhar shruti-sridhar merged commit 297dfe6 into mongodb:master Aug 15, 2024
34 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.

2 participants