@@ -202,9 +202,7 @@ class ResolvedAggregate(ResolvedFunction):
202202 # The internal rpc alias for this column
203203 internal_name : Function .ValueType
204204 # Whether to enable extrapolation
205- extrapolation_mode : ExtrapolationMode .ValueType = (
206- ExtrapolationMode .EXTRAPOLATION_MODE_SAMPLE_WEIGHTED
207- )
205+ extrapolation_mode_override : ExtrapolationMode .ValueType | None = None
208206 is_aggregate : bool = field (default = True , init = False )
209207 # Only for aggregates, we only support functions with 1 argument right now
210208 argument : AttributeKey | None = None
@@ -225,9 +223,7 @@ class ResolvedConditionalAggregate(ResolvedFunction):
225223 # The internal rpc alias for this column
226224 internal_name : Function .ValueType
227225 # Whether to enable extrapolation
228- extrapolation_mode : ExtrapolationMode .ValueType = (
229- ExtrapolationMode .EXTRAPOLATION_MODE_SAMPLE_WEIGHTED
230- )
226+ extrapolation_mode_override : ExtrapolationMode .ValueType | None = None
231227 # The condition to filter on
232228 filter : TraceItemFilter
233229 # The attribute to conditionally aggregate on
@@ -277,9 +273,7 @@ class FunctionDefinition:
277273 # The internal rpc type for this function, optional as it can mostly be inferred from search_type
278274 internal_type : AttributeKey .Type .ValueType | None = None
279275 # Whether to request extrapolation or not, should be true for all functions except for _sample functions for debugging
280- extrapolation_mode : ExtrapolationMode .ValueType = (
281- ExtrapolationMode .EXTRAPOLATION_MODE_SAMPLE_WEIGHTED
282- )
276+ extrapolation_mode_override : ExtrapolationMode .ValueType | None = None
283277 # Processor is the function run in the post process step to transform a row into the final result
284278 processor : Callable [[Any ], Any ] | None = None
285279 # if a function is private, assume it can't be used unless it's provided in `SearchResolverConfig.functions_acl`
@@ -341,7 +335,9 @@ def resolve(
341335 search_type = search_type ,
342336 internal_type = self .internal_type ,
343337 processor = self .processor ,
344- extrapolation_mode = resolve_extrapolation_mode (search_config , self .extrapolation_mode ),
338+ extrapolation_mode = resolve_extrapolation_mode (
339+ search_config , self .extrapolation_mode_override
340+ ),
345341 argument = resolved_attribute ,
346342 )
347343
@@ -404,7 +400,9 @@ def resolve(
404400 search_type = search_type ,
405401 internal_type = self .internal_type ,
406402 processor = self .processor ,
407- extrapolation_mode = resolve_extrapolation_mode (search_config , self .extrapolation_mode ),
403+ extrapolation_mode = resolve_extrapolation_mode (
404+ search_config , self .extrapolation_mode_override
405+ ),
408406 argument = resolved_attribute ,
409407 )
410408
@@ -441,7 +439,9 @@ def resolve(
441439 filter = aggregate_filter ,
442440 key = key ,
443441 processor = self .processor ,
444- extrapolation_mode = resolve_extrapolation_mode (search_config , self .extrapolation_mode ),
442+ extrapolation_mode = resolve_extrapolation_mode (
443+ search_config , self .extrapolation_mode_override
444+ ),
445445 )
446446
447447
@@ -467,7 +467,9 @@ def resolve(
467467 search_config : SearchResolverConfig ,
468468 ) -> ResolvedFormula :
469469 resolver_settings = ResolverSettings (
470- extrapolation_mode = resolve_extrapolation_mode (search_config , self .extrapolation_mode ),
470+ extrapolation_mode = resolve_extrapolation_mode (
471+ search_config , self .extrapolation_mode_override
472+ ),
471473 snuba_params = snuba_params ,
472474 query_result_cache = query_result_cache ,
473475 search_config = search_config ,
0 commit comments