From e955e0c28294e6b0f54e8c5229c55a4a698b1bee Mon Sep 17 00:00:00 2001 From: felix5572 Date: Wed, 6 Jul 2022 16:18:37 +0800 Subject: [PATCH] disable strict --- dpdispatcher/machine.py | 4 ++-- dpdispatcher/submission.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dpdispatcher/machine.py b/dpdispatcher/machine.py index 0109f11d..d84b82d5 100644 --- a/dpdispatcher/machine.py +++ b/dpdispatcher/machine.py @@ -3,7 +3,7 @@ from dpdispatcher.ssh_context import SSHSession import json from dargs import Argument, Variant -from typing import List +from typing import List, Union import pathlib from dpdispatcher import dlog from dpdispatcher.base_context import BaseContext @@ -333,7 +333,7 @@ def arginfo(cls): machine_args = [ Argument("batch_type", str, optional=False, doc=doc_batch_type), # TODO: add default to local_root and remote_root after refactor the code - Argument("local_root", str, optional=False, doc=doc_local_root), + Argument("local_root", [str, None], optional=False, doc=doc_local_root), Argument("remote_root", str, optional=True, doc=doc_remote_root), Argument("clean_asynchronously", bool, optional=True, default=False, doc=doc_clean_asynchronously), ] diff --git a/dpdispatcher/submission.py b/dpdispatcher/submission.py index 1f7a9629..4eb507e2 100644 --- a/dpdispatcher/submission.py +++ b/dpdispatcher/submission.py @@ -449,7 +449,7 @@ def load_from_dict(cls, task_dict: dict) -> "Task": # check dict base = cls.arginfo() task_dict = base.normalize_value(task_dict, trim_pattern="_*") - base.check_value(task_dict, strict=True) + base.check_value(task_dict, strict=False) task = cls.deserialize(task_dict=task_dict) return task @@ -809,7 +809,7 @@ def load_from_dict(cls, resources_dict): # check dict base = cls.arginfo(detail_kwargs='batch_type' in resources_dict) resources_dict = base.normalize_value(resources_dict, trim_pattern="_*") - base.check_value(resources_dict, strict=True) + base.check_value(resources_dict, strict=False) return cls.deserialize(resources_dict=resources_dict)