Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
shruthilayaj committed Nov 7, 2024
1 parent 01f952c commit f532342
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions snuba/subscriptions/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def run_query(
timeseries = response.result_timeseries[0]
data = [{timeseries.label: timeseries.data_points[0].data}]

result: Result = {"meta": [], "data": data, "trace_output": ""}
result = {"meta": [], "data": data, "trace_output": ""}
return QueryResult(
result=result, extra={"stats": {}, "sql": "", "experiments": {}}
)
Expand Down Expand Up @@ -445,7 +445,7 @@ def from_proto(
metadata["organization"] = item.time_series_request.meta.organization_id

return RPCSubscriptionData(
project_id=item.project_id,
project_id=item.time_series_request.meta.project_ids[0],
time_window_sec=item.time_window_secs,
resolution_sec=item.resolution_secs,
time_series_request=base64.b64encode(
Expand Down
4 changes: 2 additions & 2 deletions tests/subscriptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from snuba.datasets.entities.factory import get_entity, get_entity_name
from snuba.datasets.entity import Entity
from snuba.datasets.factory import get_dataset
from snuba.datasets.storages.factory import get_storage, get_writable_storage
from snuba.datasets.storages.factory import get_writable_storage
from snuba.datasets.storages.storage_key import StorageKey
from snuba.processor import InsertEvent
from tests.helpers import write_raw_unprocessed_events, write_unprocessed_events
Expand Down Expand Up @@ -169,7 +169,7 @@ def setup_teardown(self, clickhouse_db: None) -> None:
],
)

spans_storage = get_storage(StorageKey("eap_spans"))
spans_storage = get_writable_storage(StorageKey("eap_spans"))
messages = [
gen_span_message(self.base_time + timedelta(minutes=tick))
for tick in range(self.minutes)
Expand Down
4 changes: 2 additions & 2 deletions tests/subscriptions/test_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime
from typing import Optional, Type, Union
from typing import Optional, Type

import pytest
from sentry_protos.snuba.v1.endpoint_create_subscription_pb2 import (
Expand Down Expand Up @@ -185,7 +185,7 @@ def compare_conditions(
subscription: SubscriptionData,
exception: Optional[Type[Exception]],
aggregate: str,
value: Union[int, float],
value: Optional[int | float],
) -> None:
timer = Timer("test")
if exception is not None:
Expand Down

0 comments on commit f532342

Please sign in to comment.