Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Nov 28, 2024
1 parent 66b0a99 commit 211f6e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/ai/backend/manager/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import enum
import uuid
from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Sequence
from typing import TYPE_CHECKING, Any, Dict, Mapping, Optional, Self, Sequence

import graphene
import sqlalchemy as sa
Expand All @@ -17,7 +17,7 @@
from sqlalchemy.sql.expression import false, true

from ai.backend.common import msgpack, redis_helper
from ai.backend.common.types import AgentId, BinarySize, HardwareMetadata, ResourceSlot
from ai.backend.common.types import AccessKey, AgentId, BinarySize, HardwareMetadata, ResourceSlot

from .base import (
Base,
Expand Down Expand Up @@ -510,7 +510,7 @@ def from_row(
cls,
ctx: GraphQueryContext,
row: Row,
) -> Agent:
) -> Self:
return cls(
id=row["id"],
status=row["status"].name,
Expand Down Expand Up @@ -543,11 +543,11 @@ async def batch_load(
graph_ctx: GraphQueryContext,
agent_ids: Sequence[AgentId],
*,
domain_name: str | None,
access_key: AccessKey,
domain_name: Optional[str] = None,
raw_status: Optional[str] = None,
scaling_group: Optional[str] = None,
access_key: str,
) -> Sequence[Agent | None]:
) -> Sequence[Optional[Self]]:
query = (
sa.select([agents])
.select_from(agents)
Expand Down Expand Up @@ -609,7 +609,7 @@ async def load_slice(
raw_status: Optional[str] = None,
filter: Optional[str] = None,
order: Optional[str] = None,
) -> Sequence[Agent]:
) -> Sequence[Self]:
query = sa.select([agents]).select_from(agents).limit(limit).offset(offset)
query = await _append_sgroup_from_clause(
graph_ctx, query, access_key, domain_name, scaling_group
Expand Down
4 changes: 2 additions & 2 deletions src/ai/backend/manager/models/gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,9 @@ async def resolve_agent_summary(
if ctx.local_config["manager"]["hide-agents"]:
raise ObjectNotFound(object_name="agent")

loader = ctx.dataloader_manager.get_loader_by_func(
loader = ctx.dataloader_manager.get_loader(
ctx,
AgentSummary.batch_load,
"AgentSummary.by_id",
raw_status=None,
scaling_group=scaling_group,
domain_name=domain_name,
Expand Down

0 comments on commit 211f6e7

Please sign in to comment.