remove use of _deprecated_positional_args decorator#3093
Closed
d-v-b wants to merge 5 commits into
Closed
Conversation
* add fill_value output to info * changelog * fix tests * fix example in docs
* issues: add pep-723 to issue template * use zarr main branch + make copyable * corret example link + not uv specific
* The ruff ruleset is TC, not TCH * Apply ruff/flake8-type-checking rule TC006 TC006 Add quotes to type expression in `typing.cast()` * Apply ruff/flake8-type-checking rule TC003 TC003 Move standard library import into a type-checking block --------- Co-authored-by: David Stansby <dstansby@gmail.com>
dstansby
suggested changes
May 25, 2025
Contributor
There was a problem hiding this comment.
The intent of _deprecate_positional_args is not to make every argument keyword-only, but only the ones that are already keyword-only in the signature. So no actual arguments should be changed to be keyword only here - the decorator should merely be removed.
As a working example, note how the first call does not raise a warning, but the second call does here:
# /// script
# dependencies = [
# "zarr==3.0.8",
# ]
# ///
import zarr
root = zarr.group(store='data/example.zarr')
foo = root.create_array('foo', shape=(1000, 100), chunks=(10, 10), dtype='f4')
foo = root.create_array('foo', (1000, 100), chunks=(10, 10), dtype='f4')
Contributor
Author
|
thanks for the clarification @dstansby! I'll adjust the PR accordingly. |
Contributor
|
Woops, deleting the 3.1.0 branch accidentally closed this 🙈 - I think it needs to be reopened targeting the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For every function decorated with
_deprecate_positional_args, I removed the decoratorand made the function arguments keyword-only.This should only go in 3.1.0.
addresess #3092