-
Notifications
You must be signed in to change notification settings - Fork 3
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
119 fix aliases declaration in pipeline methods #120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -314,8 +314,7 @@ | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
Bucket( | ||||||||||||||||||||||||||||
by = by or group_by, | ||||||||||||||||||||||||||||
Check warning on line 317 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
#group_by = group_by or by, | ||||||||||||||||||||||||||||
boundaries = boundaries, | ||||||||||||||||||||||||||||
default = default, | ||||||||||||||||||||||||||||
output = output | ||||||||||||||||||||||||||||
|
@@ -371,8 +370,7 @@ | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
BucketAuto( | ||||||||||||||||||||||||||||
by = by or group_by, | ||||||||||||||||||||||||||||
Check warning on line 373 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
#group_by = group_by, | ||||||||||||||||||||||||||||
buckets = buckets, | ||||||||||||||||||||||||||||
output = output, | ||||||||||||||||||||||||||||
granularity = granularity | ||||||||||||||||||||||||||||
|
@@ -437,10 +435,10 @@ | |||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
Unwind( | ||||||||||||||||||||||||||||
Check warning on line 438 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
path=path, | ||||||||||||||||||||||||||||
path_to_array=path_to_array or path, | ||||||||||||||||||||||||||||
include_array_index=include_array_index, | ||||||||||||||||||||||||||||
always=always | ||||||||||||||||||||||||||||
always=always or preserve_null_and_empty_arrays | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
return self | ||||||||||||||||||||||||||||
|
@@ -453,7 +451,7 @@ | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Arguments: | ||||||||||||||||||||||||||||
------------------------ | ||||||||||||||||||||||||||||
- by, str | list[str] | set[str] | dict | None : field or group of fields to group by | ||||||||||||||||||||||||||||
- by (_id), str | list[str] | set[str] | dict | None : field or group of fields to group by | ||||||||||||||||||||||||||||
- query, dict | None : Computed aggregated values (per group) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Online MongoDB documentation: | ||||||||||||||||||||||||||||
|
@@ -473,9 +471,9 @@ | |||||||||||||||||||||||||||
Source : https://www.mongodb.com/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group | ||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
Check warning on line 474 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
Group( | ||||||||||||||||||||||||||||
by=by, | ||||||||||||||||||||||||||||
by=by or _id, | ||||||||||||||||||||||||||||
query=query | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
|
@@ -568,9 +566,9 @@ | |||||||||||||||||||||||||||
Lookup( | ||||||||||||||||||||||||||||
right = right, | ||||||||||||||||||||||||||||
on = on, | ||||||||||||||||||||||||||||
left_on = left_on, | ||||||||||||||||||||||||||||
right_on = right_on, | ||||||||||||||||||||||||||||
name =name | ||||||||||||||||||||||||||||
left_on = left_on or local_field, | ||||||||||||||||||||||||||||
right_on = right_on or foreign_field, | ||||||||||||||||||||||||||||
name = name | ||||||||||||||||||||||||||||
Comment on lines
567
to
+571
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
return self | ||||||||||||||||||||||||||||
|
@@ -712,8 +710,11 @@ | |||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
query = query | kwargs | ||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
Check warning on line 713 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
Match(query=query, expression=expression) | ||||||||||||||||||||||||||||
Match( | ||||||||||||||||||||||||||||
query=query, | ||||||||||||||||||||||||||||
expression=expression | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
return self | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -797,7 +798,7 @@ | |||||||||||||||||||||||||||
------------------------------------- | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- statement, dict : the statement generated during instantiation after parsing the other arguments | ||||||||||||||||||||||||||||
- path_to_new_root, str|None : the path to the embedded document to be promoted | ||||||||||||||||||||||||||||
- path_to_new_root (path), str|None : the path to the embedded document to be promoted | ||||||||||||||||||||||||||||
- document, dict|None : document being created and to be set as the new root or expression | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Online MongoDB documentation: | ||||||||||||||||||||||||||||
|
@@ -814,7 +815,10 @@ | |||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
ReplaceRoot(path=path, document=document) | ||||||||||||||||||||||||||||
ReplaceRoot( | ||||||||||||||||||||||||||||
Check warning on line 818 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
path=path or path_to_new_root, | ||||||||||||||||||||||||||||
document=document | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
return self | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -826,7 +830,7 @@ | |||||||||||||||||||||||||||
------------------------------------- | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
- statement, dict : the statement generated during instantiation after parsing the other arguments | ||||||||||||||||||||||||||||
- path_to_new_root, str|None : the path to the embedded document to be promoted | ||||||||||||||||||||||||||||
- path_to_new_root (path), str|None : the path to the embedded document to be promoted | ||||||||||||||||||||||||||||
- document, dict|None : document being created and to be set as the new root or expression | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Online MongoDB documentation: | ||||||||||||||||||||||||||||
|
@@ -843,7 +847,10 @@ | |||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
ReplaceRoot(path=path, document=document) | ||||||||||||||||||||||||||||
ReplaceRoot( | ||||||||||||||||||||||||||||
Check warning on line 850 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
path=path or path_to_new_root, | ||||||||||||||||||||||||||||
document=document | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
return self | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -1375,8 +1382,10 @@ | |||||||||||||||||||||||||||
Source : https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/#mongodb-pipeline-pipe.-unionWith | ||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
self.stages.append( | ||||||||||||||||||||||||||||
Check warning on line 1385 in src/monggregate/pipeline.py
|
||||||||||||||||||||||||||||
UnionWith(collection=collection, pipeline=pipeline) | ||||||||||||||||||||||||||||
UnionWith( | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [mypy] reported by reviewdog 🐶 |
||||||||||||||||||||||||||||
collection=collection or coll, | ||||||||||||||||||||||||||||
pipeline=pipeline) | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
return self | ||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -74,7 +74,7 @@ class Group(Stage): | |||
|
||||
Attributes: | ||||
----------- | ||||
- by, str | list[str] | set[str] | dict | None : field or group of fields to group by | ||||
- by (_id), str | list[str] | set[str] | dict | None : field or group of fields to group by | ||||
- query, dict | None : Computed aggregated values (per group) | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||
Online MongoDB documentation: | ||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -77,7 +77,7 @@ class ReplaceRoot(Stage): | |||
----------- | ||||
|
||||
- statement, dict : the statement generated during instantiation after parsing the other arguments | ||||
- path_to_new_root, str|None : the path to the embedded document to be promoted | ||||
- path_to_new_root (path), str|None : the path to the embedded document to be promoted | ||||
- document, dict|None : document being created and to be set as the new root or expression | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||
Online MongoDB documentation: | ||||
|
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.
[black-format] reported by reviewdog 🐶