Skip to content

fix: raise clear error when required SSH connection params are None#8

Open
prabindersinghh wants to merge 1 commit intoouterbounds:mainfrom
prabindersinghh:fix/validate-required-connection-params
Open

fix: raise clear error when required SSH connection params are None#8
prabindersinghh wants to merge 1 commit intoouterbounds:mainfrom
prabindersinghh:fix/validate-required-connection-params

Conversation

@prabindersinghh
Copy link
Copy Markdown

@prabindersinghh prabindersinghh commented Mar 10, 2026

Summary

Add validation for required SSH connection parameters — previously
crashed with confusing TypeError if any were None.

Context / Motivation

If a user forgets to set ssh_key_file, username, or address via
@slurm(...) or environment variables, the code crashed with:
TypeError: argument should be str or an os.PathLike object, not NoneType

This gives no indication of what went wrong or how to fix it.

Changes Made

  • Added validation in __init__ before first parameter use
  • Raises SlurmException with clear message for each missing param
  • Example: "ssh_key_file is required. Set it via @slurm(ssh_key_file=...)
    or the METAFLOW_SLURM_SSH_KEY_FILE environment variable."

Testing

Manually verified: instantiating SlurmClient with None values now
raises SlurmException with correct message instead of TypeError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant