Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions aggify/aggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,6 @@ def unwind(
self.pipelines.append(unwind_stage)
return self

def aggregate(self):
"""
Returns the aggregated results.

Returns:
The aggregated results.
"""
return self.base_model.objects.aggregate(*self.pipelines) # type: ignore

def annotate(
self, annotate_name: str, accumulator: str, f: Union[Union[str, Dict], F, int]
) -> "Aggify":
Expand Down
5 changes: 0 additions & 5 deletions tests/test_aggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,6 @@ def test_regex_f_with_others(self):
with pytest.raises(ValueError):
aggify.filter(name__contains=F("age"))

def test_aggregate_failed_connection(self):
aggify = Aggify(BaseModel)
with pytest.raises(ValueError):
aggify.filter(name__contains=F("age")).aggregate()

def test_annotate_str_field_as_value_but_not_base_model_field(self):
thing = list(Aggify(BaseModel).group("name").annotate("age", "sum", "test"))
assert thing[0]["$group"] == {"_id": "$name", "age": {"$sum": "test"}}
Expand Down