Skip to content

Hot-fix dataframe export

Choose a tag to compare

@Claptar Claptar released this 23 Mar 12:53
· 103 commits to main since this release

Summary

This hot-fix release resolves dataframe export issues affecting categorical obs/var columns:

  • Fixes crashes when categorical labels contain non-ASCII UTF-8 characters (e.g. Greek letters).
  • Fixes incorrect/empty values when exporting multiple categorical columns with h5ad export dataframe -c ....

Fixed

1) UTF-8 categorical decoding

decode_str_array now decodes byte/object arrays robustly as UTF-8 (with safe fallback), preventing errors like:

'ascii' codec can't decode byte ...

2) Categorical cache cross-column leakage

Categorical value caching now uses a stable per-column key, avoiding accidental cache reuse across different columns in the same export pass.

This fixes cases where one categorical column could appear blank or show values that belong to another categorical column.

Tests added

  • Core read regression for non-ASCII byte decoding.
  • Core read regression for multiple categorical columns sharing one export path.
  • CLI regression for export dataframe with multiple categorical columns, including UTF-8 values.

User impact

Commands such as:

h5ad export dataframe subset_1k.h5ad obs -c "age,cell_type" --head 10

and

h5ad export dataframe subset_1k.h5ad obs -c "age,sample_ID,cell_type" --head 10

now return stable, correctly populated categorical values without decode failures.

Upgrade

Install/update to h5ad==0.3.1.

Notes

  • No CLI interface changes.
  • No data format migration required.
  • This release is backward-compatible and focused on dataframe export correctness.