zarr-python icon indicating copy to clipboard operation
zarr-python copied to clipboard

Fix AsyncGroup.create_dataset() dtype handling and optimize tests #3050

Open dhruvak001 opened this issue 8 months ago • 7 comments

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 dtype is not provided in the arguments -- And if data is None (meaning no data is being provided to infer the dtype from) -- Then raise a clear error message saying "dtype must be provided if data is None"
  • This ensures that create_array() always receives the required dtype parameter, 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)

dhruvak001 avatar May 14 '25 18:05 dhruvak001

pre-commit.ci autofix

dhruvak001 avatar May 15 '25 08:05 dhruvak001

HI @d-v-b can you please review the PR. Also do I need to make separate tests for this code changes?

dhruvak001 avatar May 17 '25 04:05 dhruvak001

i'll look at this later today

d-v-b avatar May 19 '25 12:05 d-v-b

can you explain some of the changes to the hypothesis tests?

d-v-b avatar May 19 '25 13:05 d-v-b

@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 avatar May 19 '25 15:05 dhruvak001

@dhruvak001 can we see what happens in our CI tests if you roll back the changes to the hypothesis tests?

d-v-b avatar May 19 '25 15:05 d-v-b

@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 ?

dhruvak001 avatar May 19 '25 16:05 dhruvak001