Skip to content

Conversation

@wmak
Copy link
Member

@wmak wmak commented Jul 19, 2024

  • This removes the usage of ParamsType from tasks in favour of SnubaParams
  • Added stats_period as an option to SnubaParams as a way to define start and end
  • Added a filter_params property on SnubaParams to make this switchover easy so I'm impacting less code (eg. don't have to change the params references in format_top_events_timeseries_results even though params={} now)

- This removes the usage of ParamsType from tasks in favour of
  SnubaParams
- Added stats_period as an option to SnubaParams as a way to define
  start and end
@wmak wmak requested a review from a team July 19, 2024 16:17
@wmak wmak requested review from a team as code owners July 19, 2024 16:17
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 19, 2024
Comment on lines +930 to +934
params = SnubaParams(
start=end - timedelta(days=14),
end=end,
projects=projects,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't use SnubaParams(stats_period= here since the existing functionality sets end to 1hr in the future

@codecov
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 85.41667% with 7 lines in your changes missing coverage. Please review.

Project coverage is 78.17%. Comparing base (d10148c) to head (91c5fef).
Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #74570      +/-   ##
==========================================
+ Coverage   68.75%   78.17%   +9.42%     
==========================================
  Files        6687     6692       +5     
  Lines      299181   299562     +381     
  Branches    51536    51575      +39     
==========================================
+ Hits       205689   234186   +28497     
+ Misses      86738    59052   -27686     
+ Partials     6754     6324     -430     
Files Coverage Δ
src/sentry/search/events/builder/discover.py 97.74% <ø> (+3.38%) ⬆️
.../sentry/search/events/builder/profile_functions.py 90.00% <ø> (ø)
src/sentry/snuba/functions.py 85.07% <100.00%> (+3.53%) ⬆️
src/sentry/tasks/check_am2_compatibility.py 56.80% <100.00%> (+27.99%) ⬆️
src/sentry/tasks/on_demand_metrics.py 96.39% <100.00%> (+24.71%) ⬆️
src/sentry/tasks/statistical_detectors.py 94.40% <100.00%> (+19.32%) ⬆️
src/sentry/search/events/types.py 93.10% <80.55%> (-0.06%) ⬇️

... and 1393 files with indirect coverage changes

- Added automatic self.organization grabbing which the ParamsType ->
  SnubaParams converter was doing automatically
@wmak wmak merged commit 24ab0c2 into master Jul 22, 2024
@wmak wmak deleted the wmak/ref/remove-paramstype-from-tasks branch July 22, 2024 18:44
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants