fix: replace (str, Enum) with StrEnum to resolve ruff UP042

StrEnum (Python 3.11+) is the modern replacement for the (str, Enum)
pattern. Updates SyncState and PipelineState enums.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
pselamy
2026-03-10 01:17:34 +00:00
co-authored by Claude Opus 4.6
parent a263d20e58
commit 12bd40fa69
2 changed files with 4 additions and 4 deletions
@@ -11,7 +11,7 @@ import logging
from collections.abc import Callable from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from datetime import UTC, datetime from datetime import UTC, datetime
from enum import Enum from enum import StrEnum
from redis.asyncio import Redis from redis.asyncio import Redis
@@ -27,7 +27,7 @@ DEFAULT_CACHE_TTL_SECONDS = 600 # 10 minutes
DEFAULT_REDIS_KEY_PREFIX = "polymarket:market:" DEFAULT_REDIS_KEY_PREFIX = "polymarket:market:"
class SyncState(str, Enum): class SyncState(StrEnum):
"""State of the metadata synchronizer.""" """State of the metadata synchronizer."""
STOPPED = "stopped" STOPPED = "stopped"
+2 -2
View File
@@ -11,7 +11,7 @@ import contextlib
import logging import logging
from dataclasses import dataclass from dataclasses import dataclass
from datetime import UTC, datetime from datetime import UTC, datetime
from enum import Enum from enum import StrEnum
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from redis.asyncio import Redis from redis.asyncio import Redis
@@ -43,7 +43,7 @@ if TYPE_CHECKING:
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class PipelineState(str, Enum): class PipelineState(StrEnum):
"""Pipeline lifecycle states.""" """Pipeline lifecycle states."""
STOPPED = "stopped" STOPPED = "stopped"