-
Notifications
You must be signed in to change notification settings - Fork 6
[Bug] Raise error when pysqa is not available #677
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -151,6 +151,8 @@ | |||||||||||||||||
| {k: v for k, v in default_resource_dict.items() if k not in resource_dict} | ||||||||||||||||||
| ) | ||||||||||||||||||
| if not plot_dependency_graph: | ||||||||||||||||||
| import pysqa # noqa | ||||||||||||||||||
|
|
||||||||||||||||||
|
Comment on lines
+154
to
+155
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Wrap A bare - import pysqa # noqa
+ try:
+ import pysqa # noqa
+ except ModuleNotFoundError as exc:
+ raise ModuleNotFoundError(
+ "pysqa is required for SlurmClusterExecutor. "
+ "Install it with `pip install pysqa`."
+ ) from excReplicating the guard used for optional dependencies elsewhere in the codebase will improve UX and prevent support noise. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: codecov/patch[warning] 154-154: executorlib/executor/slurm.py#L154 🤖 Prompt for AI Agents |
||||||||||||||||||
| from executorlib.task_scheduler.file.task_scheduler import ( | ||||||||||||||||||
| create_file_executor, | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Mirror the safeguarded import pattern used for SLURM executor
Same rationale as in
SlurmClusterExecutor—surface a concise hint whenpysqais absent.This keeps behaviour consistent across back-ends and provides an immediate, informative error.
🤖 Prompt for AI Agents