fix: use proper callable when accessing rule proxy with associated path modifier#3763
fix: use proper callable when accessing rule proxy with associated path modifier#3763johanneskoester merged 2 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughHandles callables wrapped in _IOFile or AnnotatedString by extracting the underlying callable and applying the existing path modifier to the callable's result via an inner(wildcards) indirection instead of calling the wrapper directly. Changes
Sequence Diagram(s)sequenceDiagram
participant Rule as Rule
participant PM as PathModifier
participant Wrapper as _IOFile / AnnotatedString
participant UF as Underlying Callable
Note over PM,Wrapper: New flow for callable inputs wrapped by helpers
Rule->>PM: register input with modifier(item)
PM->>Wrapper: detect wrapper contains callable
alt wrapper contains callable
PM->>Wrapper: extract callable (item._file.callable or item.callable)
PM->>UF: call inner(wildcards) -> UF(wildcards)
UF-->>PM: path(s)
PM-->>Rule: apply modifier(path(s))
else not wrapped callable
PM-->>Rule: apply modifier(item(wildcards) or item)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.py⚙️ CodeRabbit configuration file
Files:
🧬 Code graph analysis (1)src/snakemake/rules.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (41)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/snakemake/rules.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
⚙️ CodeRabbit configuration file
**/*.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.
Files:
src/snakemake/rules.py
🧬 Code graph analysis (1)
src/snakemake/rules.py (1)
src/snakemake/io/__init__.py (4)
_IOFile(259-931)is_callable(310-311)is_callable(945-946)is_callable(1163-1168)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (45)
- GitHub Check: tests (10, ubuntu-latest, py313)
- GitHub Check: tests (10, ubuntu-latest, py312)
- GitHub Check: tests (10, windows-2022, py313)
- GitHub Check: tests (9, windows-2022, py313)
- GitHub Check: tests (10, ubuntu-latest, py311)
- GitHub Check: tests (9, ubuntu-latest, py312)
- GitHub Check: tests (5, windows-2022, py313)
- GitHub Check: tests (9, ubuntu-latest, py313)
- GitHub Check: tests (7, ubuntu-latest, py312)
- GitHub Check: tests (9, ubuntu-latest, py311)
- GitHub Check: tests (7, windows-2022, py313)
- GitHub Check: tests (8, windows-2022, py313)
- GitHub Check: tests (8, ubuntu-latest, py313)
- GitHub Check: tests (6, windows-2022, py313)
- GitHub Check: tests (6, ubuntu-latest, py311)
- GitHub Check: tests (8, ubuntu-latest, py312)
- GitHub Check: tests (8, ubuntu-latest, py311)
- GitHub Check: tests (7, ubuntu-latest, py313)
- GitHub Check: tests (7, ubuntu-latest, py311)
- GitHub Check: tests (6, ubuntu-latest, py312)
- GitHub Check: tests (6, macos-latest, py313)
- GitHub Check: tests (5, macos-latest, py313)
- GitHub Check: tests (5, ubuntu-latest, py312)
- GitHub Check: tests (5, ubuntu-latest, py313)
- GitHub Check: tests (6, ubuntu-latest, py313)
- GitHub Check: tests (5, ubuntu-latest, py311)
- GitHub Check: tests (4, windows-2022, py313)
- GitHub Check: tests (3, windows-2022, py313)
- GitHub Check: tests (4, ubuntu-latest, py312)
- GitHub Check: tests (3, macos-latest, py313)
- GitHub Check: tests (4, ubuntu-latest, py313)
- GitHub Check: tests (4, ubuntu-latest, py311)
- GitHub Check: tests (3, ubuntu-latest, py313)
- GitHub Check: tests (1, windows-2022, py313)
- GitHub Check: tests (2, ubuntu-latest, py312)
- GitHub Check: tests (3, ubuntu-latest, py312)
- GitHub Check: tests (3, ubuntu-latest, py311)
- GitHub Check: tests (2, ubuntu-latest, py311)
- GitHub Check: tests (2, ubuntu-latest, py313)
- GitHub Check: tests (2, windows-2022, py313)
- GitHub Check: tests (1, macos-latest, py313)
- GitHub Check: tests (2, macos-latest, py313)
- GitHub Check: tests (1, ubuntu-latest, py312)
- GitHub Check: tests (1, ubuntu-latest, py311)
- GitHub Check: tests (1, ubuntu-latest, py313)
🤖 I have created a release *beep* *boop* --- ## [9.11.8](v9.11.7...v9.11.8) (2025-10-02) ### Bug Fixes * use proper callable when accessing rule proxy with associated path modifier ([#3763](#3763)) ([b5d12c8](b5d12c8)) ### Documentation * add snakemake logo to automatic mastodon release posts ([#3764](#3764)) ([7b66250](7b66250)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…th modifier (snakemake#3763) ### Description <!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [ ] 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** * Ensures path modifiers are correctly applied when callable inputs are wrapped as file-like annotations, producing correct input paths. * Preserves support for unwrapped callable inputs and aligns behavior between wrapped and unwrapped callables. * Reduces unexpected path mismatches in complex workflows, improving input resolution reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
🤖 I have created a release *beep* *boop* --- ## [9.11.8](snakemake/snakemake@v9.11.7...v9.11.8) (2025-10-02) ### Bug Fixes * use proper callable when accessing rule proxy with associated path modifier ([snakemake#3763](snakemake#3763)) ([b5d12c8](snakemake@b5d12c8)) ### Documentation * add snakemake logo to automatic mastodon release posts ([snakemake#3764](snakemake#3764)) ([7b66250](snakemake@7b66250)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
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