Skip to content

PYTHON-1320 Remove legacy CRUD methods #556

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 5 commits into from
Jan 23, 2021

Conversation

ShaneHarvey
Copy link
Member

Remove save, insert, update, remove, and find_and_modify.

@ShaneHarvey ShaneHarvey marked this pull request as ready for review January 22, 2021 05:09
@@ -24,7 +24,7 @@ warning:

.. code-block:: python

# "insert.py"
# "insert.py" (with PyMongo 3.X)
Copy link
Member Author

Choose a reason for hiding this comment

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

This section provides example output for deprecation warnings which only work on PyMongo 3.X (because PyMongo 4.0 removes all the deprecated APIs).

@@ -1,4 +1,4 @@
# Copyright 2009-2015 MongoDB, Inc.
Copy link
Member Author

Choose a reason for hiding this comment

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

This benchmark actually works now.

Copy link
Member

Choose a reason for hiding this comment

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

This benchmark isn't great and never really has been. Let's just get rid of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

# Can't use fsync and j options together
self.assertRaises(ConfigurationError, WriteConcern, j=True, fsync=True)
# Can't use w=0 and j options together
self.assertRaises(ConfigurationError, WriteConcern, w=0, j=True)
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this test to avoid loosing test coverage when deleting test_legacy_api.

wait_until(lambda: 2 == db.collection_4.count_documents({}),
'insert 2 documents', timeout=60)

db.collection_4.drop()
Copy link
Member Author

Choose a reason for hiding this comment

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

Added these tests to avoid loosing test coverage when deleting test_legacy_api.

@@ -220,9 +223,9 @@ is displayed:
.. code-block:: javascript

> // mongo shell.
> db.collection.insert( { "_id" : 1, "subdocument" : { "b" : 1, "a" : 1 } } )
> db.collection.insertOne( { "_id" : 1, "subdocument" : { "b" : 1, "a" : 1 } } )
Copy link
Member Author

Choose a reason for hiding this comment

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

The shell has implemented the CRUD spec for a while now.

@@ -1,4 +1,4 @@
# Copyright 2009-2015 MongoDB, Inc.
Copy link
Member

Choose a reason for hiding this comment

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

This benchmark isn't great and never really has been. Let's just get rid of it.

@ShaneHarvey ShaneHarvey requested a review from behackett January 23, 2021 00:53
@ShaneHarvey ShaneHarvey merged commit e01d9a3 into mongodb:master Jan 23, 2021
@ShaneHarvey ShaneHarvey deleted the PYTHON-1320 branch January 23, 2021 01:14
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