-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support pymongo 4 #60
Conversation
d9b4cbe
to
6d0ee6e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #60 +/- ##
==========================================
+ Coverage 90.19% 91.10% +0.90%
==========================================
Files 43 43
Lines 6724 6702 -22
==========================================
+ Hits 6065 6106 +41
+ Misses 659 596 -63
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow what a great amount of work. It seems real good. I've posted some specific feedback, and then lets also do additional testing before we merge and release. E.g. testing with codebases that use Ming, and with pymongo actually upgraded to v4
801c5be
to
d2bf051
Compare
All the code changes look good. Lets continue to test with more codebases and maybe pymongo 4 itself, before merging. |
ming/metadata.pyi
Outdated
@@ -193,16 +193,16 @@ class _ClassManager(Generic[M]): | |||
def remove(self, spec_or_id: Union[MongoFilter, ObjectId] = None, **kwargs) -> ChangeResult: ... | |||
def count(self) -> int: ... | |||
def update_partial(self, filter: MongoFilter, fields: dict, **kwargs) -> ChangeResult: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChangeResult
is an alias for dict
(above). This should be updated to pymongo UpdateResult and DeleteResult
dc7e74a
to
e65fec5
Compare
ccf05df
to
eed990b
Compare
3772233
to
7e42e85
Compare
This was motivated by this issue #48 requesting pymongo v4 support. This PR lays the groundwork for the upgrade to pymongo4, but it stops short of actually bumping the package.
I followed pymongo's migration guide to see what was removed or deprecated then updated everything relevant in Ming. pymongo has backported many of their API changes to pymongo3 therefore I think this work should be representative.
That said, I'm sure more issues will crop up once we actually update to pymongo4, but that can be a separate chunk of work.