          self.assertEqual(repr(Upper('a')), "Upper(F(a))")
  
      def test_aggregates(self):
          self.assertEqual(repr(Avg('a')), "Avg(F(a))")
          self.assertEqual(repr(Count('a')), "Count(F(a), distinct=False)")
          self.assertEqual(repr(Count('*')), "Count('*', distinct=False)")
          self.assertEqual(repr(Max('a')), "Max(F(a))")
          self.assertEqual(repr(Min('a')), "Min(F(a))")
          self.assertEqual(repr(StdDev('a')), "StdDev(F(a), sample=False)")
          self.assertEqual(repr(Sum('a')), "Sum(F(a))")
          self.assertEqual(repr(Variance('a', sample=True)), "Variance(F(a), sample=True)")
 
</s> remove         self.assertEqual(repr(Count('a', filter=filter)), "Count(F(a), distinct=False, filter=(AND: ('a', 1)))")
 </s> add         self.assertEqual(repr(Count('a', filter=filter)), "Count(F(a), filter=(AND: ('a', 1)))") </s> remove     def __init__(self, expression, distinct=False, **extra):
        super().__init__(expression, distinct='DISTINCT ' if distinct else '', **extra)

 </s> add  </s> remove     def __init__(self, expression, delimiter, distinct=False, **extra):
        distinct = 'DISTINCT ' if distinct else ''
        super().__init__(expression, delimiter=delimiter, distinct=distinct, **extra)
 </s> add     def __init__(self, expression, delimiter, **extra):
        super().__init__(expression, delimiter=delimiter, **extra)
        self.assertEqual(repr(Count('a')), "Count(F(a))")
        self.assertEqual(repr(Count('*')), "Count('*')")
          self.assertEqual(repr(Upper('a')), "Upper(F(a))")
  
      def test_aggregates(self):
          self.assertEqual(repr(Avg('a')), "Avg(F(a))")
        self.assertEqual(repr(Count('a')), "Count(F(a))")
        self.assertEqual(repr(Count('*')), "Count('*')")
        self.assertEqual(repr(Count('a')), "Count(F(a))")
        self.assertEqual(repr(Count('*')), "Count('*')")
          self.assertEqual(repr(Max('a')), "Max(F(a))")
          self.assertEqual(repr(Min('a')), "Min(F(a))")
          self.assertEqual(repr(StdDev('a')), "StdDev(F(a), sample=False)")
          self.assertEqual(repr(Sum('a')), "Sum(F(a))")
          self.assertEqual(repr(Variance('a', sample=True)), "Variance(F(a), sample=True)")
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #28658 -- Added DISTINCT handling to the Aggregate class. 
tests/expressions/tests.py