-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…2455) Closes #2453 ## Pull Request overview * Deprecate `chunk_size` in favor of `batch_size` in `rg.log`: * Move `chunk_size` to the end of all related signatures. * Set `chunk_size` default to None and update the typing accordingly. * Introduce `batch_size` in the old position in the signature. * Update docstrings accordingly. * Introduce a `FutureWarning` if `chunk_size` is used. * Introduce test showing that `rg.log(..., chunk_size=100)` indeed throws a warning. * Update a warning to no longer include a newline and a lot of spaces (see first comment of this PR) ## Details Note that this deprecation is non-breaking: Code that uses `chunk_size` will still work, as `batch_size = chunk_size` after a FutureWarning is given, if `chunk_size` is not `None`. ## Discussion * Should I use a FutureWarning? Or a DeprecationWarning? Or a PendingDeprecationWarning? The last two make sense, but they are [ignored by default](https://docs.python.org/3/library/warnings.html#default-warning-filter), I'm afraid. * Is the deprecation message in the format that we like? --- **Type of change** - [x] New feature (non-breaking change which adds functionality) **How Has This Been Tested** I introduced a test, and ran all tests. **Checklist** - [x] I have merged the original branch into my forked branch - [x] I added relevant documentation - [x] follows the style guidelines of this project - [x] I did a self-review of my code - [x] I made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works --- - Tom Aarsen
- Loading branch information
Showing
3 changed files
with
55 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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