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

check type of attribute keys

Open malmans2 opened this issue 2 years ago • 6 comments

Closes #1037 This PR adds a check that does not allow to use attribute keys other than strings.

TODO:

  • [x] Add unit tests and/or doctests in docstrings
  • [ ] Add docstrings and API docs for any new/modified user-facing classes and functions
  • [ ] New/modified features documented in docs/tutorial.rst
  • [ ] Changes documented in docs/release.rst
  • [x] GitHub Actions have all passed
  • [x] Test coverage is 100% (Codecov passes)

malmans2 avatar Jul 04 '22 12:07 malmans2

Codecov Report

Merging #1066 (879eca2) into main (dcc6ded) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1066   +/-   ##
=======================================
  Coverage   99.94%   99.94%           
=======================================
  Files          34       34           
  Lines       13846    13865   +19     
=======================================
+ Hits        13839    13858   +19     
  Misses          7        7           
Impacted Files Coverage Δ
zarr/attrs.py 100.00% <100.00%> (ø)
zarr/tests/test_attrs.py 100.00% <100.00%> (ø)

codecov[bot] avatar Jul 04 '22 13:07 codecov[bot]

I'm not sure whether we should add a note somewhere in the documentation/docstrings. Other than that, this PR is ready for review.

cc: @joshmoore

malmans2 avatar Jul 04 '22 13:07 malmans2

@malmans2 : I don't think I can update your branch with the latest origin/main. Could you do so to get all the tests passing?

joshmoore avatar Jul 11 '22 12:07 joshmoore

@malmans2 : I don't think I can update your branch with the latest origin/main. Could you do so to get all the tests passing?

Done! Let me know if we should start a deprecation cycle.

malmans2 avatar Jul 11 '22 15:07 malmans2

Happy if someone who wants to be adventurous speaks up, but I'd err on the side of the deprecation cycle.

joshmoore avatar Jul 11 '22 16:07 joshmoore

Sorry for the delay, @malmans2, and thanks for the deprecation cycle. If we're temporarily accepting the stringification, would you be able to workaround your TypeError by explicitly calling str()?

joshmoore avatar Jul 20 '22 01:07 joshmoore

Thanks, @malmans2! Rolling into 2.13

joshmoore avatar Sep 08 '22 06:09 joshmoore