-
Notifications
You must be signed in to change notification settings - Fork 10
fix: test size method #78
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
Conversation
📝 WalkthroughWalkthroughA new assertion was added in snakemake_interface_storage_plugins/tests.py to check that obj.size() returns a non-negative integer, placed after the existing mtime() type check. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing Touches
🧪 Generate unit tests
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
snakemake_interface_storage_plugins/tests.py (1)
99-99: Cache size() result; optionally assert 0 for directories
obj.size()may hit remote storage. It’s called twice here; cache it. Also, per StorageObject docs, directories should report size 0—consider asserting that whendirectory=True.- assert isinstance(obj.size(), int) and obj.size() >= 0 + size_ = obj.size() + assert isinstance(size_, int) and size_ >= 0 + if directory: + assert size_ == 0
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_interface_storage_plugins/tests.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:
snakemake_interface_storage_plugins/tests.py
🧬 Code graph analysis (1)
snakemake_interface_storage_plugins/tests.py (2)
snakemake_interface_storage_plugins/io.py (1)
size(93-93)snakemake_interface_storage_plugins/storage_object.py (1)
size(148-150)
🔇 Additional comments (1)
snakemake_interface_storage_plugins/tests.py (1)
99-99: Confirm correctsize()interface in this test
Ensureobjis aStorageObjectwhose size() returns anint, not the I/O interface’s size() returningDict[str, int], to avoid ambiguity in the assertion.
Summary by CodeRabbit