-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-4940 - Add index hint as an explicit parameter for distinct command. #2225
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
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!
Ah, except typing:
|
Fixed! |
if hint is not None: | ||
if not isinstance(hint, str): | ||
hint = helpers_shared._index_document(hint) | ||
cmd["hint"] = hint # type: ignore[assignment] |
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.
We still need to add tests for this like we do for other helpers that accept hint
.
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.
Tests besides the spec tests? The spec tests that verify this change were already present in our repo.
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.
Yes because we have python specific behavior, like accepting hint="str" and hint=[pairs].
We already supported
hint
fordistinct()
throughkwargs
, but we didn't mention it. Now we explicitly support it similarly to the otherCollection
methods.