ruff: Fix UP006 Use list instead of List for type annotation.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-07-11 17:30:17 -07:00
committed by Tim Abbott
parent c2214b3904
commit e08a24e47f
457 changed files with 3588 additions and 3857 deletions

View File

@@ -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]