docs: Clarify the lookup function docstring#3091
docs: Clarify the lookup function docstring#3091johanneskoester merged 4 commits intosnakemake:mainfrom
Conversation
This described the is_nrows argument, and tries to make it clear what applies with a mapping input.
|
Warning Rate limit exceeded@peterjc has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 37 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes made to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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
Outside diff range and nitpick comments (2)
snakemake/ioutils.py (2)
144-145: Documentation looks good, but please fix the spelling error.The addition of the documentation for the
is_nrowsargument is helpful in clarifying its behavior when used with a pandas DataFrame.However, please fix the spelling error:
-Finally, if the interger argument ``is_nrows`` is used, this returns true +Finally, if the integer argument ``is_nrows`` is used, this returns trueTools
GitHub Check: Check for spelling errors
[failure] 144-144:
interger ==> integer
122-122: Please fix the spelling error.-case use ``query``, and optionaly ``cols`` and ``is_nrows``), or a Python +case use ``query``, and optionally ``cols`` and ``is_nrows``), or a PythonTools
GitHub Check: Check for spelling errors
[failure] 122-122:
optionaly ==> optionally
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- snakemake/ioutils.py (2 hunks)
Additional context used
Path-based instructions (1)
snakemake/ioutils.py (1)
Pattern
**/*.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.
GitHub Check: Check for spelling errors
snakemake/ioutils.py
[failure] 122-122:
optionaly ==> optionally
[failure] 144-144:
interger ==> integer
Additional comments not posted (2)
snakemake/ioutils.py (2)
121-123: LGTM!The changes to the docstring provide clearer documentation on the expected types for the
withinargument and the corresponding arguments to use with each type. This improves the understanding of how to use thelookupfunction correctly.Tools
GitHub Check: Check for spelling errors
[failure] 122-122:
optionaly ==> optionally
150-154: Great improvement to the documentation!The changes provide clearer documentation on the behavior when
withinis a Python mapping. Explicitly stating thatquery,cols, andis_nrowsare ignored in this case helps avoid confusion.Additionally, documenting the
defaultargument and theLookupErrorexception improves clarity around error handling.
There was a problem hiding this comment.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- snakemake/ioutils.py (2 hunks)
Additional context used
Path-based instructions (1)
snakemake/ioutils.py (1)
Pattern
**/*.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.
GitHub Check: Check for spelling errors
snakemake/ioutils.py
[failure] 122-122:
optionaly ==> optionally
Additional comments not posted (1)
snakemake/ioutils.py (1)
Line range hint
121-154: Documentation changes look good!The updated documentation provides clearer guidance on the function's parameters and their expected behavior:
- Explicitly defines the
withinparameter to accept either a pandas DataFrame, Series, or a Python mapping.- Clarifies that when a Python mapping is used, the
dpathparameter is employed, while thequery,cols, andis_nrowsarguments are disregarded.- Specifies that if the
dpathis not found, aLookupErrorwill be raised unless a default fallback value is provided via thedefaultargument.These enhancements improve the understanding of the function's behavior across different input types and strengthen error handling.
|
🤖 I have created a release *beep* *boop* --- ## [8.20.4](v8.20.3...v8.20.4) (2024-09-20) ### Bug Fixes * cache conda envs to fix performance regression introduced in #1300 ([#3093](#3093)) ([66600c4](66600c4)) * Flatten conda pip dependencies for report rule info ([#3085](#3085)) ([56a1f20](56a1f20)) * improve runtime complexity of post-job checkpoint handling ([#3096](#3096)) ([ba30781](ba30781)) ### Documentation * Clarify the lookup function docstring ([#3091](#3091)) ([94177d5](94177d5)) * Update lookup signature ([#3090](#3090)) ([655d6a1](655d6a1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



This described the is_nrows argument, and tries to make it clear what applies with a mapping input.
[It does seem this would be cleaner as two functions, one for pandas lookup, one for dpath]
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
lookupfunction, clarifying parameter usage and behavior.