Skip to content

Conversation

@Yaqiang
Copy link
Contributor

@Yaqiang Yaqiang commented May 27, 2025

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"

…an type, it can not be converted to String with 'String(val)'. String.valueOf(val) will solve it.
@Yaqiang Yaqiang requested a review from lesserwhirls as a code owner May 27, 2025 04:51
@lesserwhirls
Copy link
Member

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
Copy link
Contributor Author

Yaqiang commented Jun 20, 2025

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
Copy link
Member

Thank you so much for your efforts @Yaqiang!

@lesserwhirls lesserwhirls merged commit 4bc9c9c into Unidata:maint-5.x Jun 20, 2025
16 checks passed
@lesserwhirls lesserwhirls added this to the 5.8.1 milestone Jul 2, 2025
@lesserwhirls lesserwhirls added the iosp: zarr zarr format label Jul 2, 2025
@lesserwhirls lesserwhirls modified the milestones: 5.8.1, v5.9 Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iosp: zarr zarr format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants