From c18f5043f326d52fdebba2f62ab79700f57de2ed Mon Sep 17 00:00:00 2001 From: dachengx Date: Fri, 12 Apr 2024 06:44:49 -0500 Subject: [PATCH] Set default `bypass_validation` as empty list --- utilix/batchq.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utilix/batchq.py b/utilix/batchq.py index 0c563f0..e32fe08 100644 --- a/utilix/batchq.py +++ b/utilix/batchq.py @@ -185,7 +185,7 @@ def _skip_validation(cls, field: str, values: Dict[Any, Any]) -> bool: # validate the bypass_validation so that it can be reached in values @validator("bypass_validation", pre=True, each_item=True) - def check_bypass_validation(cls, v: str) -> str: + def check_bypass_validation(cls, v: list) -> list: return v @validator("bind", pre=True, each_item=True) @@ -248,8 +248,6 @@ def check_qos(cls, v: str, values: Dict[Any, Any]) -> str: """ if cls._skip_validation("qos", values): return v - if "qos" in values.get("bypass_validation", []): - return v qos_list = _get_qos_list() if v not in qos_list: # Raise an error if the qos is not in the list of available qos @@ -495,7 +493,7 @@ def submit_job( exclude_nodes: Optional[str] = None, dependency: Optional[str] = None, verbose: bool = False, - bypass_validation: Optional[List[str]] = None, + bypass_validation: Optional[List[str]] = [], ) -> None: """ Submit a job to the SLURM queue.