fix: corner case bug causing key error when module statement is used without config directive; better error message when empty string is defined as input or output file#3792
Merged
johanneskoester merged 5 commits intomainfrom Oct 17, 2025
Conversation
Contributor
📝 WalkthroughWalkthroughUpdated IO error text for empty file paths; ensured module initialization always provides a config dict and always spawns a new checkpoints namespace; adjusted module parent-modifier assignment and skip_configfile logic; updated a module test Snakefile to include two configfile declarations; pinned Python in three notebook test envs to 3.13. Changes
Sequence Diagram(s)sequenceDiagram
participant WF as Workflow
participant WM as WorkflowModifier
participant Mod as Module Snakefile
Note over WF,WM: Module initialization flow (high level)
WF->>WM: instantiate WorkflowModifier(is_module, config, workflow)
alt module initialization
WM->>WM: globals["config"] = config or {}
WM->>WM: globals["checkpoints"] = globals["checkpoints"].spawn_new_namespace()
WF->>WM: workflow.modifier
WM->>WM: parent_modifier = workflow.modifier
WM->>WM: skip_configfile = (parent_modifier != None)
else non-module path
WF->>WM: workflow.modifier
WM->>WM: parent_modifier = workflow.modifier
WM->>WM: skip_configfile = (parent_modifier != None)
end
opt not skip_configfile
WM->>Mod: evaluate `configfile:` statements inside module
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
johanneskoester
approved these changes
Oct 17, 2025
johanneskoester
pushed a commit
that referenced
this pull request
Oct 17, 2025
🤖 I have created a release *beep* *boop* --- ## [9.13.3](v9.13.2...v9.13.3) (2025-10-17) ### Bug Fixes * corner case bug causing key error when module statement is used without config directive; better error message when empty string is defined as input or output file ([#3792](#3792)) ([640c549](640c549)) * make `--containerize` consider conda env specs from all rules, not just from dry-run DAG jobs ([#3783](#3783)) ([d092d8c](d092d8c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kjohnsen
pushed a commit
to kjohnsen/snakemake
that referenced
this pull request
Dec 15, 2025
…without config directive; better error message when empty string is defined as input or output file (snakemake#3792) will close snakemake#3774 and close snakemake#3754 ### QC * [ ] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [x] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). example for returning an empty list to indicate no input can be found in https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#the-exists-function <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved error message for empty file paths, guiding users to use an empty list to indicate “no file.” * Module configuration now defaults to an empty config when none is provided, improving predictability. * **Tests** * Updated module tests to cover multiple configfile declarations and missing configs. * Test environments pinned to Python 3.13 to ensure consistent test runs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
kjohnsen
pushed a commit
to kjohnsen/snakemake
that referenced
this pull request
Dec 15, 2025
🤖 I have created a release *beep* *boop* --- ## [9.13.3](snakemake/snakemake@v9.13.2...v9.13.3) (2025-10-17) ### Bug Fixes * corner case bug causing key error when module statement is used without config directive; better error message when empty string is defined as input or output file ([snakemake#3792](snakemake#3792)) ([640c549](snakemake@640c549)) * make `--containerize` consider conda env specs from all rules, not just from dry-run DAG jobs ([snakemake#3783](snakemake#3783)) ([d092d8c](snakemake@d092d8c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
will close #3774 and close #3754
QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).example for returning an empty list to indicate no input can be found in https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#the-exists-function
Summary by CodeRabbit
Bug Fixes
Tests