Skip to content

Commit e9b0f43

Browse files
authored
allow batch_type with strict check; check kwargs when batch_type exsits (#186)
1 parent 3f19e37 commit e9b0f43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dpdispatcher/submission.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ def load_from_json(cls, json_file):
803803
@classmethod
804804
def load_from_dict(cls, resources_dict):
805805
# check dict
806-
base = cls.arginfo(detail_kwargs=False)
806+
base = cls.arginfo(detail_kwargs='batch_type' in resources_dict)
807807
resources_dict = base.normalize_value(resources_dict, trim_pattern="_*")
808808
base.check_value(resources_dict, strict=True)
809809

@@ -864,6 +864,9 @@ def arginfo(detail_kwargs=True):
864864
resources_args.append(
865865
Argument("kwargs", dict, optional=True, doc="Vary by different machines.")
866866
)
867+
resources_args.append(
868+
Argument("batch_type", str, optional=True, doc="Allow this key when strict checking.")
869+
)
867870
resources_format = Argument("resources", dict, resources_args)
868871
return resources_format
869872

0 commit comments

Comments
 (0)