Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Remove unused Union import and add type hinting for get_cache_se…
…rvice
  • Loading branch information
ogabrielluiz committed Dec 10, 2025
commit 11911599efb6023e2e158432fcd9ee7a2ed38ea9
12 changes: 6 additions & 6 deletions src/backend/base/langflow/services/deps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from contextlib import asynccontextmanager
from typing import TYPE_CHECKING, Union
from typing import TYPE_CHECKING
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Union is needed in import


from langflow.services.schema import ServiceType

Expand All @@ -23,11 +23,11 @@
# These imports MUST be outside TYPE_CHECKING because FastAPI uses eval_str=True
# to evaluate type annotations, and these types are used as return types for
# dependency functions that FastAPI evaluates at module load time.
from lfx.services.settings.service import SettingsService
from lfx.services.settings.service import SettingsService # noqa: TC002

from langflow.services.job_queue.service import JobQueueService
from langflow.services.storage.service import StorageService
from langflow.services.telemetry.service import TelemetryService
from langflow.services.job_queue.service import JobQueueService # noqa: TC001
from langflow.services.storage.service import StorageService # noqa: TC001
from langflow.services.telemetry.service import TelemetryService # noqa: TC001


def get_service(service_type: ServiceType, default=None):
Expand Down Expand Up @@ -176,7 +176,7 @@ async def session_scope() -> AsyncGenerator[AsyncSession, None]:
yield session


def get_cache_service() -> Union[CacheService, AsyncBaseCacheService]:
def get_cache_service() -> CacheService | AsyncBaseCacheService:
"""Retrieves the cache service from the service manager.

Returns:
Expand Down