Skip to content

remove use of _deprecated_positional_args decorator #3093

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

Open
wants to merge 5 commits into
base: 3.1.0
Choose a base branch
from

Conversation

d-v-b
Copy link
Contributor

@d-v-b d-v-b commented May 24, 2025

For every function decorated with _deprecate_positional_args, I removed the decorator and made the function arguments keyword-only.

This should only go in 3.1.0.

addresess #3092

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label May 24, 2025
@d-v-b d-v-b added this to the 3.1.0 milestone May 24, 2025
d-v-b and others added 4 commits May 25, 2025 10:24
* 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 <[email protected]>
Copy link
Contributor

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')

@d-v-b
Copy link
Contributor Author

d-v-b commented May 26, 2025

thanks for the clarification @dstansby! I'll adjust the PR accordingly.

@d-v-b d-v-b changed the title make some function arguments keyword-only remove use of _deprecated_positional_args decorator May 26, 2025
@d-v-b d-v-b changed the base branch from main to 3.1.0 May 26, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs release notes Automatically applied to PRs which haven't added release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants