Skip to content

Commit 64df70e

Browse files
committed
feat: replace string types with enums for schema and status in UrlService methods for improved type safety
1 parent 21e94c7 commit 64df70e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

services/url_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ async def _populate_cache(
573573
self,
574574
short_code: str,
575575
url_cache_data: UrlCacheData,
576-
schema: str,
576+
schema: SchemaVersion,
577577
) -> None:
578578
"""
579579
Cache the URL data according to caching rules:
@@ -600,7 +600,7 @@ async def _generate_unique_alias(self) -> str:
600600
# ── Module-level helpers ──────────────────────────────────────────────────────
601601

602602

603-
def _raise_for_status(status: str) -> None:
603+
def _raise_for_status(status: UrlStatus) -> None:
604604
if status == UrlStatus.BLOCKED:
605605
raise BlockedUrlError("URL is blocked")
606606
raise GoneError("URL has expired or is no longer active")

0 commit comments

Comments
 (0)