Skip to content
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

SON manipulator is deprecated in pymongo>4.0 #276

Open
heuristicus opened this issue Aug 16, 2022 · 0 comments
Open

SON manipulator is deprecated in pymongo>4.0 #276

heuristicus opened this issue Aug 16, 2022 · 0 comments

Comments

@heuristicus
Copy link

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.

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

No branches or pull requests

1 participant