Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get

/src/sentry/search/events/ @getsentry/data-browsing
/src/sentry/search/eap/ @getsentry/data-browsing
/src/sentry/search/exceptions.py @getsentry/data-browsing

/src/sentry/issue_detection/ @getsentry/issue-detection-backend
/tests/sentry/issue_detection/ @getsentry/issue-detection-backend
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/incidents/utils/process_update_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sentry.incidents.utils.types import QuerySubscriptionUpdate
from sentry.search.eap.utils import add_start_end_conditions
from sentry.search.events.datasets.discover import InvalidIssueSearchQuery
from sentry.search.exceptions import InvalidIssueSearchQuery
from sentry.snuba.dataset import Dataset
from sentry.snuba.entity_subscription import (
ENTITY_TIME_COLUMNS,
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/search/eap/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
from sentry.search.events import constants as qb_constants
from sentry.search.events import fields
from sentry.search.events import filter as event_filter
from sentry.search.events.datasets.discover import InvalidIssueSearchQuery
from sentry.search.events.filter import to_list
from sentry.search.events.types import SAMPLING_MODES, SnubaParams
from sentry.search.exceptions import InvalidIssueSearchQuery


def collect_issue_short_ids_from_parsed_terms(terms: Sequence[object]) -> set[str]:
Expand Down
12 changes: 1 addition & 11 deletions src/sentry/search/events/datasets/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,13 @@
)
from sentry.search.events.filter import to_list
from sentry.search.events.types import SelectType, WhereType
from sentry.search.exceptions import InvalidIssueSearchQuery
from sentry.search.utils import DEVICE_CLASS
from sentry.snuba.dataset import Dataset
from sentry.snuba.referrer import Referrer
from sentry.utils.numbers import format_grouped_length


class InvalidIssueSearchQuery(InvalidSearchQuery):
"""Raised when an issue filter references non-existent issue IDs."""

def __init__(self, invalid_ids: list[str]):
self.invalid_ids = invalid_ids
super().__init__(f"Issue IDs do not exist: {invalid_ids}")

def __str__(self) -> str:
return f"Issue IDs do not exist: {self.invalid_ids}"


class DiscoverDatasetConfig(DatasetConfig):
custom_threshold_columns = {
"apdex()",
Expand Down
12 changes: 12 additions & 0 deletions src/sentry/search/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from sentry.exceptions import InvalidSearchQuery


class InvalidIssueSearchQuery(InvalidSearchQuery):
"""Raised when an issue filter references non-existent issue IDs."""

def __init__(self, invalid_ids: list[str]):
self.invalid_ids = invalid_ids
super().__init__(f"Issue IDs do not exist: {invalid_ids}")

def __str__(self) -> str:
return f"Issue IDs do not exist: {self.invalid_ids}"
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sentry.incidents.utils.process_update_helpers import get_aggregation_value
from sentry.incidents.utils.types import QuerySubscriptionUpdate
from sentry.search.events.datasets.discover import InvalidIssueSearchQuery
from sentry.search.exceptions import InvalidIssueSearchQuery
from sentry.snuba.dataset import Dataset
from sentry.snuba.entity_subscription import get_entity_subscription_from_snuba_query
from sentry.snuba.models import SnubaQuery, SnubaQueryEventType
Expand Down
Loading