Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default bypass_validation as empty list #99

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions utilix/batchq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Loading