Skip to content

Support for pymongo 3 #214

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

Merged
merged 28 commits into from
Jul 12, 2015
Merged

Conversation

markunsworth
Copy link
Contributor

Support for Pymongo 3.0.

  • Removed use of the fields keyword argument when calling find, as this has changed to projection in pymongo 3.0. Use positional argument instead.
  • Have removed the use of safe and slave_okay keyword arguments as these are no longer used and have been deprecated since 2.4

Fix the broken tests.

  • Have changed the DatabaseOperation.sqlflush method to now check if a collection is capped before trying to remove the data
  • Removed tests that are no longer relevant.

Fixes #207 and #209

@markunsworth
Copy link
Contributor Author

Fixes issues mentioned in #210

@aburgel
Copy link
Member

aburgel commented Jun 19, 2015

I think this needs to be rebased since I merged in your safe writes PR.

@aburgel
Copy link
Member

aburgel commented Jun 19, 2015

Can you also pull in some of the documentation updates from #208?

@markunsworth
Copy link
Contributor Author

Ok - will merge those into this branch.

@aburgel
Copy link
Member

aburgel commented Jun 23, 2015

@ajdavis mentioned that pymongo 2.9 will be compatible with both 2.8 and 3.0, so can we standardize on that?

If its too much work, I'm happy to cut a new version and require 3.0.

@markunsworth
Copy link
Contributor Author

Could be an option to maintain a 0.5.x branch for supporting pymongo < 3 and use 0.6.x (master) for pymongo 3 onwards.

We can use pymongo >= 2.9, but i don't think some of the other changes (e.g. removing MongoReplicaSetClient in favour of MongoClient for connecting to replica sets) are being backported. @ajdavis might be able to clarify on that.

Pymongo 3 still supports the old crud API (find, update, remove) so I think anyone using it directly will still be able to do pretty much everything they are doing with 2.x

…ong pull request). pip install from tarballs
@ajdavis
Copy link

ajdavis commented Jun 23, 2015

MongoReplicaSetClient lives on in 3.0 as a synonym for MongoClient, so you
can continue to use it.

On Tuesday, June 23, 2015, Mark Unsworth [email protected] wrote:

We can require pymongo >= 2.9, but i don't think some of the other changes
(e.g. removing MongoReplicaSetClient in favour of MongoClient for
connecting to replica sets) are being backported. @ajdavis
https://github.com/ajdavis might be able to clarify on that.

Pymongo 3 still supports the old crud API (find, update, remove) so I
think anyone using it directly will still be able to do pretty much
everything they are doing with 2.x


Reply to this email directly or view it on GitHub
#214 (comment)
.

@markunsworth
Copy link
Contributor Author

There seems to be an issue since moving to use the nonrel-1.6 branch from nonrel-1.6-beta use to the use of transaction.atomic() in the flush command.

Added a workaround of setting DatabaseFeatures.can_rollback_ddl = True which works but doesn't feel right given it's not true. Ultimately that property is used to check if the atomic call should set a savepoint.

Some feedback would be useful here

@markunsworth
Copy link
Contributor Author

ok - we now have backwards compatibility with 2.x

Have also added more configurations to the environment matrix to test against the latest 2.x and 3.x versions

@markunsworth markunsworth changed the title Feature/pymongo 3 Supoort for pymongo 3 Jun 26, 2015
@markunsworth markunsworth changed the title Supoort for pymongo 3 Support for pymongo 3 Jun 26, 2015
- DJANGO_VERSION=1.6 PYMONGO_VERSION=2.8.1
- DJANGO_VERSION=1.6 PYMONGO_VERSION=3.0.2
- DJANGO_VERSION=1.7 PYMONGO_VERSION=2.8.1
- DJANGO_VERSION=1.7 PYMONGO_VERSION=3.0.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does django 1.7 actually work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet (am planning to look at that next). I've added it to the allowable failures for now

@aburgel
Copy link
Member

aburgel commented Jun 28, 2015

does any of this depend on django-nonrel/django#22?

@aburgel aburgel mentioned this pull request Jun 28, 2015
@markunsworth
Copy link
Contributor Author

@aburgel No, django-nonrel/django#22 isn't necessary for this to work.

aburgel added a commit that referenced this pull request Jul 12, 2015
@aburgel aburgel merged commit 54bf64a into django-nonrel:master Jul 12, 2015
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

Successfully merging this pull request may close these issues.

3 participants