Skip to content

Commit

Permalink
fix: Mishandling of scheduled_at in gql
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed May 7, 2024
1 parent bf93da5 commit 359ed75
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ai/backend/manager/models/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
)
from .group import groups
from .image import ImageNode
from .minilang import JSONFieldItem
from .minilang.ordering import ColumnMapType, QueryOrderParser
from .minilang.queryfilter import FieldSpecType, QueryFilterParser, enum_field_getter
from .user import users
Expand Down Expand Up @@ -870,7 +869,7 @@ def parse_row(cls, ctx: GraphQueryContext, row: KernelRow) -> Mapping[str, Any]:
"created_at": row.created_at,
"terminated_at": row.terminated_at,
"starts_at": row.starts_at,
"scheduled_at": scheduled_at or None,
"scheduled_at": scheduled_at,
"occupied_slots": row.occupied_slots.to_json(),
# resources
"agent": row.agent if not hide_agents else None,
Expand Down Expand Up @@ -924,7 +923,7 @@ async def resolve_abusing_report(
"created_at": ("created_at", dtparse),
"status_changed": ("status_changed", dtparse),
"terminated_at": ("terminated_at", dtparse),
"scheduled_at": (JSONFieldItem("status_history", KernelStatus.SCHEDULED.name), dtparse),
"scheduled_at": ("scheduled_at", None),
}

_queryorder_colmap: ColumnMapType = {
Expand All @@ -941,7 +940,7 @@ async def resolve_abusing_report(
"status_changed": ("status_info", None),
"created_at": ("created_at", None),
"terminated_at": ("terminated_at", None),
"scheduled_at": (JSONFieldItem("status_history", KernelStatus.SCHEDULED.name), None),
"scheduled_at": ("scheduled_at", None),
}

@classmethod
Expand Down

0 comments on commit 359ed75

Please sign in to comment.