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

Import error with PyMongo==4.1.1. #278

Closed
javelin opened this issue May 5, 2022 · 4 comments
Closed

Import error with PyMongo==4.1.1. #278

javelin opened this issue May 5, 2022 · 4 comments

Comments

@javelin
Copy link

javelin commented May 5, 2022

Code breaks collection.py when it tries to import _UOP from pymongo.bulk as evident in the traceback below:

import txmongo
File "/Users/mark/Dev/mine/tpikar/venv/lib/python3.9/site-packages/txmongo/__init__.py", line 7, in <module>
from txmongo.database import Database
File "/Users/mark/Dev/mine/tpikar/venv/lib/python3.9/site-packages/txmongo/database.py", line 9, in <module>
from txmongo.collection import Collection
File "/Users/mark/Dev/mine/tpikar/venv/lib/python3.9/site-packages/txmongo/collection.py", line 14, in <module>
from pymongo.bulk import _Bulk, _COMMANDS, _UOP
builtins.ImportError: cannot import name '_UOP' from 'pymongo.bulk' (/home/mark/Dev/mine/project/venv/lib/python3.9/site-packages/pymongo/bulk.py)

It seems _UOP is no longer defined in PyMongo 4.1.1 and "op" is just used instead in pymongo.bulk:

$ grep "\op\"" *.py
bulk.py: replacement["op"] = run.ops[idx]

This may also be a problem with earlier versions of PyMongo but I only tried 4.1.1.

@IlyaSkriblovsky
Copy link
Contributor

Sorry, seems we need to fix compatibility with newer PyMongo versions...

@whophil
Copy link

whophil commented Sep 17, 2022

I'm interested in getting this fixed for a downstream project. Is this actively being worked on? If not, would you accept contributions @IlyaSkriblovsky ?

@IlyaSkriblovsky
Copy link
Contributor

@whophil Unfortunately, the project is not being actively developed. But I would be happy to merge your pull request!

@NikolayBaranovv
Copy link
Contributor

close after #290

@psi29a psi29a closed this as completed Sep 30, 2024
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

5 participants