-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat: Make extrapolation mode an enum #103071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
15fe602
03461a3
5564f9a
0a33a34
670af02
2aa855a
0a60289
b3e6458
f2f3ef7
3f039d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| from sentry_protos.snuba.v1.trace_item_attribute_pb2 import ExtrapolationMode | ||
|
|
||
| from sentry.search.eap.types import SearchResolverConfig | ||
|
|
||
|
|
||
| def resolve_extrapolation_mode( | ||
| search_config: SearchResolverConfig, | ||
| argument_override: ExtrapolationMode.ValueType | None = None, | ||
| ) -> ExtrapolationMode.ValueType: | ||
| if search_config.disable_aggregate_extrapolation: | ||
| return ExtrapolationMode.EXTRAPOLATION_MODE_NONE | ||
|
|
||
| if argument_override: | ||
| return argument_override | ||
|
|
||
| if search_config.extrapolation_mode is not None: | ||
| return search_config.extrapolation_mode | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Python Falsy: Unspecified Enums Vanish.The truthiness checks |
||
|
|
||
| return ExtrapolationMode.EXTRAPOLATION_MODE_SAMPLE_WEIGHTED | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated across the 3 events endpoints, should we make it a shared function to reduce the risk that they may diverge accidentally?