Skip to content

SON manipulator is deprecated in pymongo>4.0 #276

Open

Description

@heuristicus

When using ROS noetic and installing pymongo with pip3 install pymongo, you will receive a version which is above 4.0. The config manager uses an SON manipulator which was deprecated in 4.0. You can find some information at https://pymongo.readthedocs.io/en/stable/migrate-to-pymongo4.html#sonmanipulator-is-removed.

The simplest workaround is to install an earlier version of pymongo, which can be done with

pip3 install -Iv pymongo==3.12.3

3.12.3 is the latest version before 4.0.

The SON manipulator is applied in these lines:

https://github.com/mongodb/mongo-python-driver/blob/0869a5e890291ac3dd824f2b0021c7a0fb51b061/pymongo/database.py#L472-L494

One of those functions is actually called manually at

existing_value = self._database._fix_outgoing(existing['value'], defaults_collection)

The changes required are to manually apply the transformation functions which exist now to each insertion/read from the database. This means that the find_one, update, insert, and maybe delete functions might need to be wrapped.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions