-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3227 Clustered Indexes for all Collections #971
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
Conversation
test/unified_format.py
Outdated
self.test.assertIsInstance(actual, abc.MutableSequence) | ||
|
||
self.test.assertIsInstance( | ||
actual, (abc.MutableSequence, pymongo.command_cursor.CommandCursor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary because list_indexes
returns a CommandCursor, not a MutableSequence like expected. We do not seem to test the type of the output of list_indexes elsewhere in the spec tests, and in the pymongo specific tests we always convert to list immediately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's return a list from _collectionOperation_listIndexes instead. That's what we do for find and listCollections.
name: <string>, // optional, otherwise automatically generated | ||
v: <int>, // optional, must be ‘2’ if provided | ||
} | ||
|
||
- `**kwargs` (optional): additional keyword arguments will | ||
be passed as options for the `create collection command`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this description of kwargs, I wonder if it would be more consistent to not add an explicit "clustered_index" parameter and instead document clusteredIndex as an acceptable kwarg below. If so, we probably do the same for encrypted_fields.
We would make the same change to Collection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM!
test/unified_format.py
Outdated
self.test.assertIsInstance(actual, abc.MutableSequence) | ||
|
||
self.test.assertIsInstance( | ||
actual, (abc.MutableSequence, pymongo.command_cursor.CommandCursor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's return a list from _collectionOperation_listIndexes instead. That's what we do for find and listCollections.
pymongo/database.py
Outdated
- `**kwargs` (optional): additional keyword arguments will | ||
be passed as options for the `create collection command`_ | ||
Examples of valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still a few test failures related to encryptedFields to be resolved.
pymongo/collection.py
Outdated
name: <string>, // optional, otherwise automatically generated | ||
v: <int>, // optional, must be ‘2’ if provided | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this section to avoid duplicating the docs. We already document encryptedFields/clusteredIndex and other options in create_collection and instantiating a Collection directly is uncommon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@juliusgeo you picked up a merge conflict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.