Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle fill_value datatype for string-array #140

Merged
merged 4 commits into from
Feb 3, 2025
Merged

Conversation

zqfang
Copy link
Contributor

@zqfang zqfang commented Jan 31, 2025

this PR is related to the issue here: kaizhang/anndata-rs#15

@LDeakin Can you help review this PR if you have time ? I can make further changes if it looks the right workaround

@zqfang zqfang requested a review from LDeakin as a code owner January 31, 2025 07:36
@LDeakin
Copy link
Owner

LDeakin commented Jan 31, 2025

What zarr-python seemingly does with a 0 fill value is map it to an empty string "", but this maps 0 to "0". All you really need to do is check if the fill value is 0 (like in the bool/int workaround) and map to an empty string (like in the string/null workaround).

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.13%. Comparing base (d5a5021) to head (69e2270).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #140      +/-   ##
==========================================
+ Coverage   82.10%   82.13%   +0.02%     
==========================================
  Files         173      173              
  Lines       24495    24499       +4     
==========================================
+ Hits        20112    20122      +10     
+ Misses       4383     4377       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LDeakin LDeakin merged commit 20089c5 into LDeakin:main Feb 3, 2025
22 checks passed
@LDeakin
Copy link
Owner

LDeakin commented Feb 3, 2025

Thanks for the contribution! I minimised the change in order to not be overly permissive and added some tests.

In writing the tests, I noted a bug in zarr-python itself: zarr-developers/zarr-python#2792

LDeakin added a commit that referenced this pull request Feb 3, 2025
@zqfang
Copy link
Contributor Author

zqfang commented Feb 3, 2025

ahh, your implementation is much cleaner and better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants