bugfix for zarr attribute reading by Yaqiang · Pull Request #1453 · Unidata/netcdf-java

@Yaqiang

bugfix for zarr attribute reading. If the attribute value is Boolean type, it can not be converted to String with 'String(val)'.

Description of Changes

Using 'String.valueOf(val)' to avoid the type conversion problem of 'String(val)'

Example data file

z0_atm.zip

PR Checklist

  • Link to any issues that the PR addresses
  • Add labels
  • Open as a draft PR
    until ready for review
  • Make sure GitHub tests pass
  • Mark PR as "Ready for Review"

@Yaqiang

…an type, it can not be converted to String with 'String(val)'. String.valueOf(val) will solve it.

@lesserwhirls

Greetings @Yaqiang! Thank you for your contribution, and sorry for the delay - we've been on furlough for the past several weeks, but have now returned. The example file you've attached is fairly small. If you have the time, would you mind adding that to cdm/zarr/src/test/data/ and adding a simple test to cdm/zarr/src/test/java/ucar/nc2/iosp/zarr/TestZarrIosp.java?

@Yaqiang

… test function in TestZarrIosp.java file.
… test function in TestZarrIosp.java file.

@Yaqiang

Greetings @Yaqiang! Thank you for your contribution, and sorry for the delay - we've been on furlough for the past several weeks, but have now returned. The example file you've attached is fairly small. If you have the time, would you mind adding that to cdm/zarr/src/test/data/ and adding a simple test to cdm/zarr/src/test/java/ucar/nc2/iosp/zarr/TestZarrIosp.java?

I am quite busy these days and just add the test zarr file and test function following your comment.

@lesserwhirls

Thank you so much for your efforts @Yaqiang!