Skip to content

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
@d-v-b d-v-b requested a review from dstansby June 6, 2025 12:05
@dstansby dstansby deleted the branch zarr-developers:3.1.0 June 17, 2025 08:00
@dstansby dstansby closed this Jun 17, 2025
@dstansby
Copy link
Contributor

Woops, deleting the 3.1.0 branch accidentally closed this 🙈 - I think it needs to be reopened targeting the main branch

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