Skip to content

fix(aci): type tsdb_function correctly, don't use as class var #88038

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

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

cathteng
Copy link
Member

Fixes SENTRY-3R0P

The Delegator is added in getsentry, and has additional checks to make sure backend service functions are used correctly.

When tsdb_function is used as a ClassVar, calling self.tsdb_function() will pass self as an extra argument into the function, which causes the error. Use the tsdb_functions directly instead of storing them as class vars, and improve typing for these functions.

@cathteng cathteng requested a review from a team as a code owner March 26, 2025 22:00
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 26, 2025
@cathteng cathteng enabled auto-merge (squash) March 26, 2025 22:02
@@ -460,6 +474,7 @@ def batch_query(
model = get_issue_tsdb_group_model(category)
# InvalidFilter should not be raised for errors
results = self.get_chunked_result(
tsdb_function=tsdb.backend.get_sums,
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this seems simpler and you don't really need to declare them on the class level anyway.

@cathteng cathteng merged commit e8b0503 into master Mar 27, 2025
48 checks passed
@cathteng cathteng deleted the cathy/aci/type-tsdb-function branch March 27, 2025 16:24
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2025
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.

4 participants