Correctly handle HDF5 fillvalue for string dtype arrays.#988
Open
sharkinsspatial wants to merge 1 commit into
Open
Correctly handle HDF5 fillvalue for string dtype arrays.#988sharkinsspatial wants to merge 1 commit into
sharkinsspatial wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #988 +/- ##
==========================================
- Coverage 89.97% 89.93% -0.04%
==========================================
Files 33 33
Lines 2064 2077 +13
==========================================
+ Hits 1857 1868 +11
- Misses 207 209 +2
🚀 New features to boost your workflow:
|
This was referenced May 11, 2026
maxrjones
reviewed
May 11, 2026
Comment on lines
+85
to
+86
| if dtype.kind == "O": | ||
| dtype = np.dtypes.StringDType() |
Member
There was a problem hiding this comment.
Suggested change
| if dtype.kind == "O": | |
| dtype = np.dtypes.StringDType() | |
| # Discriminate against other object-kind HDF5 dtypes (vlen arrays, object/ | |
| # region references) that would silently be coerced to StringDType and | |
| # produce garbage downstream — those aren't supported yet, so fail loudly. | |
| if h5py.check_string_dtype(dtype) is not None: | |
| dtype = np.dtypes.StringDType() | |
| elif dtype.kind == "O": | |
| raise NotImplementedError( | |
| f"HDF5 object dtype {dtype!r} is not a variable-length string and " | |
| f"is not yet supported by HDFParser. h5py exposes vlen arrays " | |
| f"(`h5py.vlen_dtype`) and object/region references " | |
| f"(`h5py.ref_dtype`, `h5py.regionref_dtype`) as numpy object dtype; " | |
| f"please open an issue if your file needs one of these." | |
| ) |
I don't think all hdf5 object-kind dtypes are variable-length strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Updated the HDF5 parser to support string dtype arrays with a
bytesorstrfillvalue.Acceptance criteria: