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

PyMongo 4.0 includes breaking changes #782

Closed
jmosbacher opened this issue Nov 30, 2021 · 3 comments
Closed

PyMongo 4.0 includes breaking changes #782

jmosbacher opened this issue Nov 30, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@jmosbacher
Copy link
Member

jmosbacher commented Nov 30, 2021

pymongo 4.0 was released with some breaking changes and since our requirement for this package is not pinned (comes from strax) this is causing tests to fail.

So far I found two issues that need fixing to adapt to the new version:

  1. Cursor no longer has the .count() method, needs to be replaced with collection.count_documents(query)
  2. GridFS no longer computes the md5 hash for you. We need to add this ourselves.
  3. Looks like default readPreference is now Primary, since our primary is not accessible from everywhere this causes server selection timeout in tests. When using utilix to get the client this is not an issue since utilix sets the readPreference explicitly (thanks to @ershockley s superior attention to details)

There may be others. will add them here as I find them.

@jmosbacher jmosbacher added the bug Something isn't working label Nov 30, 2021
@JoranAngevaare
Copy link
Contributor

One other thing that is that tz_aware is now set to default to False, I'm quite sure that will induce a lot of issues in e.g. bootstrax

@JoranAngevaare
Copy link
Contributor

Thanks for the issue, it's now in the requirements file so I'll close the issue for now

@jmosbacher
Copy link
Member Author

Should we open an issue in strax for each of the known issues that need to be solved before we move to pymongo 4.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants