There are quite a few methods that were removed or changed in the jump from pymongo3 to pymongo4. Many of these have been back-ported to pymongo3.
In coordination with Ming, we should incrementally work towards pymongo4. A good way to accomplish this is to keep pymongo3 but migrate to the new api in as many places as possible.
I have completed this prep on branch
dw/8565
However, these updates were made in concert with pre-release Ming changes. We shouldn't merge this branch until a new version of Ming has been published that includes its own API migration prep.
Allura/allura/lib/custom_middleware.py
remove the'group'
method wrapping.estimated_document_count()
what do you think about.count({})
? It seems like estimated_document_count should be reliable in nearly all cases, but I don't like the name, it makes it seem unreliable. And its long.find_and_modify
hadnew=True
, butfind_one_and_update
doesn’t have that kwarg, it has aupsert
kwarg instead.Looking pretty good, just reviewing the code. Haven't actually tried running it
When we get everything updated, we can remove the ming & pymongo lines in pytest.ini that make it
ignore
deprecation warnings.