Skip to content

Commit 524e613

Browse files
authored
Merge pull request #21 from mahdihaghverdi/issue#18
fix issue #18
2 parents 77ae54d + 2c9c19d commit 524e613

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

aggify/aggify.py

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def __to_aggregate(self, query: dict[str, Any]) -> None:
209209
]
210210
)
211211

212+
@last_out_stage_check
212213
def __getitem__(self, index: slice | int) -> "Aggify":
213214
"""
214215
# TODO: missing docs

tests/test_aggify.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,12 @@ def test_out_with_project_stage_error(self):
358358
@pytest.mark.parametrize(
359359
("method", "args"),
360360
(
361-
("group", ("_id",)),
362-
("order_by", ("field",)),
363-
("raw", ({"$query": "query"},)),
364-
("add_fields", ({"$field": "value"},)),
365-
("filter", (Q(age=20),)),
361+
("group", ("_id",)),
362+
("order_by", ("field",)),
363+
("raw", ({"$query": "query"},)),
364+
("add_fields", ({"$field": "value"},)),
365+
("filter", (Q(age=20),)),
366+
("__getitem__", (slice(2, 10),))
366367
),
367368
)
368369
def test_out_stage_error(self, method, args):

0 commit comments

Comments
 (0)