Skip to content

Commit 0a01720

Browse files
jopemachineclaude
andcommitted
revert(BA-5978): leave gql_legacy/scaling_group.py untouched
The extraction of ``ScalingGroupOpts.model_validate(...)`` into a named variable was a stylistic refactor unrelated to the validation error work — drop it to keep the PR diff minimal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 33f6d5f commit 0a01720

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/ai/backend/manager/api/gql_legacy/scaling_group.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -677,14 +677,13 @@ def to_updater(self, name: str) -> Updater[ScalingGroupRow]:
677677
driver=OptionalState.from_graphql(self.driver),
678678
driver_opts=OptionalState.from_graphql(self.driver_opts),
679679
)
680-
validated_scheduler_opts: Any
681-
if self.scheduler_opts is not None and self.scheduler_opts is not Undefined:
682-
validated_scheduler_opts = ScalingGroupOpts.model_validate(self.scheduler_opts)
683-
else:
684-
validated_scheduler_opts = Undefined
685680
scheduler_spec = ScalingGroupSchedulerConfigUpdaterSpec(
686681
scheduler=OptionalState.from_graphql(self.scheduler),
687-
scheduler_opts=OptionalState.from_graphql(validated_scheduler_opts),
682+
scheduler_opts=OptionalState.from_graphql(
683+
ScalingGroupOpts.model_validate(self.scheduler_opts)
684+
if self.scheduler_opts is not None and self.scheduler_opts is not Undefined
685+
else Undefined
686+
),
688687
)
689688
spec = ScalingGroupUpdaterSpec(
690689
status=status_spec,
@@ -716,7 +715,6 @@ async def mutate(
716715
props: CreateScalingGroupInput,
717716
) -> CreateScalingGroup:
718717
graph_ctx: GraphQueryContext = info.context
719-
scheduler_opts = ScalingGroupOpts.model_validate(props.scheduler_opts)
720718
spec = ScalingGroupCreatorSpec(
721719
name=name,
722720
description=props.description,
@@ -727,7 +725,7 @@ async def mutate(
727725
driver=props.driver,
728726
driver_opts=props.driver_opts,
729727
scheduler=props.scheduler,
730-
scheduler_opts=scheduler_opts,
728+
scheduler_opts=ScalingGroupOpts.model_validate(props.scheduler_opts),
731729
use_host_network=bool(props.use_host_network),
732730
)
733731
creator = Creator(spec=spec)

0 commit comments

Comments
 (0)