Skip to content

Commit

Permalink
Merge pull request #41 from mohamadkhalaj/main
Browse files Browse the repository at this point in the history
Remove unused function
  • Loading branch information
mohamadkhalaj authored Nov 5, 2023
2 parents b731307 + 0608f34 commit 4d95035
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
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

0 comments on commit 4d95035

Please sign in to comment.