Repository navigation
feat: allow to combine cases with otherwise in branch function - #4262
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthrough
ChangesBranch case fallback
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/snakemake/ioutils/branch.py`:
- Around line 49-51: Update the missing-case raise in the branch handling logic
after handle_callable(otherwise, wildcards) to use from None, suppressing the
underlying mapping lookup KeyError while preserving the existing custom error
message.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8a120197-ad3b-4641-9eb5-ffe07d46da47
📒 Files selected for processing (2)
docs/snakefiles/rules.rstsrc/snakemake/ioutils/branch.py
johanneskoester
pushed a commit
that referenced
this pull request
Jul 30, 2026
🤖 I have created a release *beep* *boop* --- ## [9.24.0](v9.23.1...v9.24.0) (2026-07-30) ### Features * allow to combine cases with otherwise in branch function ([#4262](#4262)) ([000ff52](000ff52)) ### Bug Fixes * avoid config hash crash for non-serializable values ([#4241](#4241)) ([1a27746](1a27746)) * compilation error when final line contains an f-string ([#4234](#4234)) ([9c5e7fe](9c5e7fe)) * Group error log formatting ([#4256](#4256)) ([bb6dcde](bb6dcde)) * leak of benchmark monitor threads ([#4259](#4259)) ([d37852e](d37852e)) * no benchmark warning when a process exits before it can be sampled ([#4260](#4260)) ([6738359](6738359)) * persistence starttime unset/defaults ([#4251](#4251)) ([56395c0](56395c0)) --- 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.
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).AI-assistance disclosure
I used AI assistance for:
Summary by CodeRabbit
New Features
otherwisefallback when abranch()condition does not match any key incases.Bug Fixes
KeyErrormessages.casesandotherwiseto be used together.Documentation
otherwise.