Skip to content

feat(metrcis): Add formula -if combinators#112016

Open
wmak wants to merge 2 commits intomasterfrom
wmak/feat/add-formula-if-combinators
Open

feat(metrcis): Add formula -if combinators#112016
wmak wants to merge 2 commits intomasterfrom
wmak/feat/add-formula-if-combinators

Conversation

@wmak
Copy link
Copy Markdown
Member

@wmak wmak commented Apr 1, 2026

  • Add the same combinator to our per_second and per_minute formulas
  • Do a best effort to fix _get_rate_unit
    • use function regex instead of just doing starts with
    • use arithmetic parsing instead of doing starts with
    • arithmetic units are still wrong... but we currently need it for the frontend

- Add the same combinator to our per_second and per_minute formulas
- Do a best effort to fix _get_rate_unit
	- use function regex instead of just doing starts with
	- use arithmetic parsing instead of doing starts with
	- arithmetic units are still wrong... but we currently need it
	  for the frontend
@wmak wmak requested a review from a team as a code owner April 1, 2026 17:08
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 1, 2026
@getsentry getsentry deleted a comment from sentry bot Apr 1, 2026
@getsentry getsentry deleted a comment from cursor bot Apr 1, 2026
from sentry.api.serializers.snuba import SnubaTSResultSerializer
from sentry.api.utils import handle_query_errors
from sentry.discover.arithmetic import is_equation, strip_equation
from sentry.discover.arithmetic import is_equation, parse_arithmetic, strip_equation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix attempt detected (commit b5cdf2e)

The commit refactored _get_rate_unit to call parse_arithmetic without exception handling, which was the core issue reported, but failed to wrap this call in the try/except block that was explicitly recommended to handle ArithmeticError exceptions that can be raised during parsing.

The original issue appears unresolved. Please review and try again.

Evaluated by Warden

@getsentry getsentry deleted a comment from sentry-warden bot Apr 1, 2026
@getsentry getsentry deleted a comment from sentry-warden bot Apr 1, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@getsentry getsentry deleted a comment from github-actions bot Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant