chore: improved changes for param inheritance#3627
chore: improved changes for param inheritance#3627johanneskoester merged 1 commit intosnakemake:mainfrom
Conversation
📝 WalkthroughWalkthroughThe logic for handling the "params" attribute in the ruleinfo modifier was refined to ensure unpacking only occurs when the attribute is present. The code now checks that Changes
Possibly related PRs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/snakemake/ruleinfo.py (2)
79-81: Prefer direct attribute access over__dict__for clarity.
self.paramsis already guaranteed to be non-Noneby the guard on line 75, so the extra indirection throughself.__dict__is unnecessary and slightly obscures intent. A small refactor improves readability without changing behaviour:-original_positional, original_keyword = self.__dict__["params"] +original_positional, original_keyword = self.params🧰 Tools
🪛 Pylint (3.3.7)
[error] 79-79: Attempting to unpack a non-sequence defined at line 24
(E0633)
95-97: Potential silent override when originalparamsisNone.If the original rule has no
params, theelsebranch assignsvaluewholesale. That’s fine, but it silently discards any positional/keyword separation logic you implemented above. Consider documenting this behaviour or logging a debug message so users understand that inheritance becomes a full replacement in this edge case.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/snakemake/ruleinfo.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
src/snakemake/ruleinfo.py
🪛 Pylint (3.3.7)
src/snakemake/ruleinfo.py
[error] 79-79: Attempting to unpack a non-sequence defined at line 24
(E0633)
⏰ Context from checks skipped due to timeout of 90000ms (36)
- GitHub Check: tests (10, windows-latest, py312)
- GitHub Check: tests (9, ubuntu-latest, py312)
- GitHub Check: tests (10, ubuntu-latest, py312)
- GitHub Check: tests (9, windows-latest, py312)
- GitHub Check: tests (9, ubuntu-latest, py311)
- GitHub Check: tests (10, ubuntu-latest, py311)
- GitHub Check: tests (8, windows-latest, py312)
- GitHub Check: tests (8, ubuntu-latest, py312)
- GitHub Check: tests (8, ubuntu-latest, py311)
- GitHub Check: tests (6, windows-latest, py312)
- GitHub Check: tests (7, ubuntu-latest, py312)
- GitHub Check: tests (7, macos-latest, py312)
- GitHub Check: tests (5, windows-latest, py312)
- GitHub Check: tests (6, macos-latest, py312)
- GitHub Check: tests (7, windows-latest, py312)
- GitHub Check: tests (4, windows-latest, py312)
- GitHub Check: tests (7, ubuntu-latest, py311)
- GitHub Check: tests (6, ubuntu-latest, py311)
- GitHub Check: tests (5, macos-latest, py312)
- GitHub Check: tests (6, ubuntu-latest, py312)
- GitHub Check: tests (4, ubuntu-latest, py311)
- GitHub Check: tests (5, ubuntu-latest, py311)
- GitHub Check: tests (4, macos-latest, py312)
- GitHub Check: tests (3, windows-latest, py312)
- GitHub Check: tests (5, ubuntu-latest, py312)
- GitHub Check: tests (4, ubuntu-latest, py312)
- GitHub Check: tests (2, macos-latest, py312)
- GitHub Check: tests (2, windows-latest, py312)
- GitHub Check: tests (3, ubuntu-latest, py311)
- GitHub Check: tests (1, windows-latest, py312)
- GitHub Check: tests (1, ubuntu-latest, py311)
- GitHub Check: tests (2, ubuntu-latest, py311)
- GitHub Check: tests (3, ubuntu-latest, py312)
- GitHub Check: tests (2, ubuntu-latest, py312)
- GitHub Check: tests (1, ubuntu-latest, py312)
- GitHub Check: apidocs
🔇 Additional comments (1)
src/snakemake/ruleinfo.py (1)
72-79: Guard condition fixes a potentialTypeError– good catch!Replacing the check on
valuewithself.params is not Noneprevents unpackingNoneand eliminates theTypeErrorflagged by pylint.
No further issues observed in this block.🧰 Tools
🪛 Pylint (3.3.7)
[error] 79-79: Attempting to unpack a non-sequence defined at line 24
(E0633)
[refactor] 72-98: Too many nested blocks (6/5)
(R1702)
### Description Follow-up change on merged PR snakemake#3624 , inspired by suggested PR snakemake#3496 (probs to @Hocnonsense ). ### QC * [x] 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). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of rule parameters to prevent errors when parameters are missing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Follow-up change on merged PR #3624 , inspired by suggested PR #3496 (probs to @Hocnonsense ).
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).Summary by CodeRabbit