Fix AsyncGroup.create_dataset() dtype handling and optimize tests #3050
Fixes https://github.com/zarr-developers/zarr-python/issues/3050
Core Fix in AsyncGroup.create_dataset():
- The issue was that when creating a dataset without providing data, the method wasn't properly handling the required dtype parameter
- Added a validation check that:
-- If
dtypeis not provided in the arguments -- Andif data is None(meaning no data is being provided to infer the dtype from) -- Then raise a clear error message saying "dtypemust be provided ifdata is None" - This ensures that
create_array()always receives the requireddtypeparameter, preventing potential errors downstream
Please let me know if there is any changes needed in the issue fix.
TODO:
- [ ] Add unit tests and/or doctests in docstrings
- [ ] Add docstrings and API docs for any new/modified user-facing classes and functions
- [x] New/modified features documented in
docs/user-guide/*.rst - [x] Changes documented as a new file in
changes/ - [ ] GitHub Actions have all passed
- [ ] Test coverage is 100% (Codecov passes)
pre-commit.ci autofix
HI @d-v-b can you please review the PR. Also do I need to make separate tests for this code changes?
i'll look at this later today
can you explain some of the changes to the hypothesis tests?
@d-v-b When running tests locally, I was encountering issue with slow test running or test running more than the default deadline for some particular tests. I tried some changes with the fix but still it was the same. Hence I tried to avoid and optimize the test codes.
@dhruvak001 can we see what happens in our CI tests if you roll back the changes to the hypothesis tests?
@d-v-b yup it passes even after reverting changes. Thankyou. And for the codecov patch error do i need to add a special testcase for this particular issue changes ?