Skip to content

Commit

Permalink
Merge pull request #21 from mahdihaghverdi/issue#18
Browse files Browse the repository at this point in the history
fix issue #18
  • Loading branch information
seyed-dev authored Oct 30, 2023
2 parents 77ae54d + 2c9c19d commit 524e613
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions aggify/aggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def __to_aggregate(self, query: dict[str, Any]) -> None:
]
)

@last_out_stage_check
def __getitem__(self, index: slice | int) -> "Aggify":
"""
# TODO: missing docs
Expand Down
11 changes: 6 additions & 5 deletions tests/test_aggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,12 @@ def test_out_with_project_stage_error(self):
@pytest.mark.parametrize(
("method", "args"),
(
("group", ("_id",)),
("order_by", ("field",)),
("raw", ({"$query": "query"},)),
("add_fields", ({"$field": "value"},)),
("filter", (Q(age=20),)),
("group", ("_id",)),
("order_by", ("field",)),
("raw", ({"$query": "query"},)),
("add_fields", ({"$field": "value"},)),
("filter", (Q(age=20),)),
("__getitem__", (slice(2, 10),))
),
)
def test_out_stage_error(self, method, args):
Expand Down

0 comments on commit 524e613

Please sign in to comment.