#8565 Prepare for Upgrade to Pymongo 4

unreleased
open
None
General
nobody
2024-07-02
2024-06-27
No

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.

Related

Commit: [30a5b0]

Discussion

  • Dillon Walls - 2024-06-27

    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.

     
  • Dave Brondsema

    Dave Brondsema - 2024-07-01
    • Allura/allura/lib/custom_middleware.py remove the 'group' method wrapping
    • instead of .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 had new=True, but find_one_and_update doesn’t have that kwarg, it has a upsert kwarg instead.

    Looking pretty good, just reviewing the code. Haven't actually tried running it

     
  • Dave Brondsema

    Dave Brondsema - 2024-07-02

    When we get everything updated, we can remove the ming & pymongo lines in pytest.ini that make it ignore deprecation warnings.

     

Log in to post a comment.