Skip to content

ensure_bytes on buf for pcodec decode #756

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 1 commit into
base: main
Choose a base branch
from

Conversation

slowjazz
Copy link

Decoding with PCodec is causing issues in upstream zarr because it's being expected to handle numpy arrays. It seems like the other codecs in this library perform input validation in their respective implementations and generally support numpy arrays as a buffer-like.

This PR:

  • calls ensure_bytes on the input type for PCodec.decode()
  • updates unit tests. the former check_encode_decode_array_to_bytes seems to be a more restrictive version of check_encode_decode_array.

ref: zarr-developers/zarr-python#3176

TODO:

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • Docs build locally
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

@slowjazz slowjazz marked this pull request as ready for review June 27, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant