From 4a9c0e2666a8f69085c52eec17a5de30dc7d3537 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 8 Apr 2024 19:48:27 +0200 Subject: [PATCH] refactor(commands): change the signature of `_to_single_command` --- antarest/study/storage/variantstudy/command_factory.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/antarest/study/storage/variantstudy/command_factory.py b/antarest/study/storage/variantstudy/command_factory.py index 33aa9b13c2..c4803ce0cc 100644 --- a/antarest/study/storage/variantstudy/command_factory.py +++ b/antarest/study/storage/variantstudy/command_factory.py @@ -74,7 +74,7 @@ def __init__( patch_service=patch_service, ) - def _to_single_command(self, command_id: t.Optional[str], action: str, args: JSON, version: int) -> ICommand: + def _to_single_command(self, action: str, args: JSON, version: int, command_id: t.Optional[str]) -> ICommand: """Convert a single CommandDTO to ICommand.""" if action in COMMAND_MAPPING: command_class = COMMAND_MAPPING[action] @@ -101,10 +101,10 @@ def to_command(self, command_dto: CommandDTO) -> t.List[ICommand]: """ args = command_dto.args if isinstance(args, dict): - return [self._to_single_command(command_dto.id, command_dto.action, args, command_dto.version)] + return [self._to_single_command(command_dto.action, args, command_dto.version, command_dto.id)] elif isinstance(args, list): return [ - self._to_single_command(command_dto.id, command_dto.action, argument, command_dto.version) + self._to_single_command(command_dto.action, argument, command_dto.version, command_dto.id) for argument in args ] raise NotImplementedError()