  ]
  
  
  class StatAggregate(Aggregate):
      def __init__(self, y, x, output_field=FloatField(), filter=None):
          if not x or not y:
              raise ValueError('Both y and x must be provided.')
          super().__init__(y, x, output_field=output_field, filter=filter)
  
      def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False):
 
</s> remove 
    def __init__(self, y, x, filter=None):
        super().__init__(y=y, x=x, output_field=IntegerField(), filter=filter)
 </s> add     output_field = IntegerField() </s> remove     @property
    def output_field(self):
        return fields.BooleanField()

 </s> add  </s> remove         output_field = copy.output_field
        explicit_output_field = field.__class__ != copy.output_field.__class__
 </s> add         class_output_field = self.__class__.output_field if isinstance(self.__class__.output_field, Field) else None
        output_field = class_output_field or copy.output_field
        has_explicit_output_field = class_output_field or field.__class__ is not copy.output_field.__class__ </s> remove         super().__init__(expression, string, output_field=FloatField(), **extra)
 </s> add         super().__init__(expression, string, **extra)
    output_field = FloatField()

    def __init__(self, y, x, output_field=None, filter=None):
  ]
  
  
  class StatAggregate(Aggregate):
    output_field = FloatField()

    def __init__(self, y, x, output_field=None, filter=None):
          if not x or not y:
              raise ValueError('Both y and x must be provided.')
          super().__init__(y, x, output_field=output_field, filter=filter)
  
      def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False):
keep keep keep keep replace keep keep keep keep keep
 Fixed #28492 -- Defined default output_field of expressions at the class level.

This wasn't possible when settings were accessed during Field initialization
time as our test suite setup script was triggering imports of expressions
before settings were configured. 
django/contrib/postgres/aggregates/statistics.py