Open
Conversation
This is recommended by flake8:
./mongomock/aggregate.py:1434:45: E712 comparison to False should be 'if cond is not False:' or 'if cond:'
This helper will be used for aggregation operators for sets.
According to the documentation, the order of the elements resulting from a set operation is unspecified.
That way, both $setUnion and $setEquals inherit the missing features that are already implemented for $setIntersection, such as validation and the correct behavior when the dictionaries have keys in different order, for which we also add tests similar to the ones for $setIntersection.
This patch fixes some issues when the argument of an operator is a literal array with reference to some variable or document path (e.g. ['$foo.bar', 1]). Note that not all places where we made the replacement check whether the returned type is really a list, so this patch also addd a TODO comment so we do not miss that. This commit should to fix mongomock#700 ("$concatArrays doesn't seem to handle when it should replace variable inside a list"). A test case is added for such scenario. We also add a similar test case for the $map operator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.