Skip to content

Commit ef3c0fb

Browse files
committed
fix: Do not use JSONString
1 parent 2a4bee1 commit ef3c0fb

File tree

1 file changed

+8
-10
lines changed
  • src/ai/backend/manager/api/gql/scaling_group

1 file changed

+8
-10
lines changed

src/ai/backend/manager/api/gql/scaling_group/types.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import strawberry
1010
from strawberry.relay import Node, NodeID
11+
from strawberry.scalars import JSON
1112

12-
from ai.backend.common.json import dump_json_str
13-
from ai.backend.manager.api.gql.base import JSONString, OrderDirection, StringFilter
13+
from ai.backend.manager.api.gql.base import OrderDirection, StringFilter
1414
from ai.backend.manager.data.scaling_group.types import ScalingGroupData
1515
from ai.backend.manager.repositories.base import (
1616
QueryCondition,
@@ -67,7 +67,7 @@ class ScalingGroupDriverConfig:
6767
"""Driver configuration for a scaling group."""
6868

6969
name: str
70-
options: JSONString
70+
options: JSON
7171

7272

7373
@strawberry.type
@@ -76,9 +76,9 @@ class ScalingGroupSchedulerOptions:
7676

7777
allowed_session_types: list[str]
7878
pending_timeout: float
79-
config: JSONString
79+
config: JSON
8080
agent_selection_strategy: str
81-
agent_selector_config: JSONString
81+
agent_selector_config: JSON
8282
enforce_spreading_endpoint_replica: bool
8383
allow_fractional_resource_fragmentation: bool
8484
route_cleanup_target_statuses: list[str]
@@ -122,7 +122,7 @@ def from_dataclass(cls, data: ScalingGroupData) -> Self:
122122
),
123123
driver=ScalingGroupDriverConfig(
124124
name=data.driver.name,
125-
options=dump_json_str(data.driver.options),
125+
options=data.driver.options,
126126
),
127127
scheduler=ScalingGroupSchedulerConfig(
128128
name=data.scheduler.name,
@@ -131,11 +131,9 @@ def from_dataclass(cls, data: ScalingGroupData) -> Self:
131131
st.value for st in data.scheduler.options.allowed_session_types
132132
],
133133
pending_timeout=data.scheduler.options.pending_timeout.total_seconds(),
134-
config=dump_json_str(data.scheduler.options.config),
134+
config=data.scheduler.options.config,
135135
agent_selection_strategy=data.scheduler.options.agent_selection_strategy.value,
136-
agent_selector_config=dump_json_str(
137-
data.scheduler.options.agent_selector_config
138-
),
136+
agent_selector_config=data.scheduler.options.agent_selector_config,
139137
enforce_spreading_endpoint_replica=data.scheduler.options.enforce_spreading_endpoint_replica,
140138
allow_fractional_resource_fragmentation=data.scheduler.options.allow_fractional_resource_fragmentation,
141139
route_cleanup_target_statuses=data.scheduler.options.route_cleanup_target_statuses,

0 commit comments

Comments
 (0)