mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 19:13:53 +00:00
ruff: Fix UP006 Use list instead of List for type annotation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
c2214b3904
commit
e08a24e47f
@@ -1,5 +1,5 @@
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Dict, Optional, Set
|
||||
from typing import Optional
|
||||
|
||||
from django.db.models import Sum
|
||||
from django.utils.timezone import now as timezone_now
|
||||
@@ -9,7 +9,7 @@ from analytics.models import StreamCount
|
||||
from zerver.models import Realm
|
||||
|
||||
|
||||
def get_streams_traffic(stream_ids: Set[int], realm: Realm) -> Optional[Dict[int, int]]:
|
||||
def get_streams_traffic(stream_ids: set[int], realm: Realm) -> Optional[dict[int, int]]:
|
||||
if realm.is_zephyr_mirror_realm:
|
||||
# We do not need traffic data for streams in zephyr mirroring realm.
|
||||
return None
|
||||
@@ -41,7 +41,7 @@ STREAM_TRAFFIC_CALCULATION_MIN_AGE_DAYS = 7
|
||||
|
||||
|
||||
def get_average_weekly_stream_traffic(
|
||||
stream_id: int, stream_date_created: datetime, recent_traffic: Dict[int, int]
|
||||
stream_id: int, stream_date_created: datetime, recent_traffic: dict[int, int]
|
||||
) -> Optional[int]:
|
||||
try:
|
||||
stream_traffic = recent_traffic[stream_id]
|
||||
|
||||
Reference in New Issue
Block a user