Add complex dtype support to FillValueCoder for Zarr backend by maxrjones · Pull Request #11151 · pydata/xarray

This PR adds support for encoding/decoding complex fill values (complex64, complex128) in the Zarr backend's FillValueCoder, which previously raised ValueError for complex dtypes. This enables converting/virtualizing NetCDF files with these fill values to Zarr. As an example, this change unlocks virtualizing full NISAR granules using VirtualiZarr + Xarray.

Each component (real/imag) is base64-encoded as a little-endian double, consistent with how float fill values are already handled and ensuring safe JSON round-tripping of special values like NaN and Infinity.

  • Closes #xxxx
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst