Skip to content

fix: keep fill value and attributes in from_array - #4288

Open
paraseba wants to merge 1 commit into
zarr-developers:mainfrom
paraseba:fix-from-array-keep-fill-value-attributes
Open

fix: keep fill value and attributes in from_array#4288
paraseba wants to merge 1 commit into
zarr-developers:mainfrom
paraseba:fix-from-array-keep-fill-value-attributes

Conversation

@paraseba

@paraseba paraseba commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

from_array discards both fill_value and attributes.

An explicit fill_value=None now means the dtype's default scalar (v3) or a null fill value (v2), consistent with create_array, and an empty attributes dict opts out of copying the source's attributes.

Fixes #4287

Author attestation

  • I am a human, these are my changes, and I have reviewed and understood every change and can explain why each is correct.

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.19%. Comparing base (d44f9f9) to head (b7decb5).

Files with missing lines Patch % Lines
src/zarr/testing/stateful.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4288      +/-   ##
==========================================
+ Coverage   94.12%   94.19%   +0.06%     
==========================================
  Files          92       92              
  Lines       12831    12825       -6     
==========================================
+ Hits        12077    12080       +3     
+ Misses        754      745       -9     
Files with missing lines Coverage Δ
src/zarr/api/synchronous.py 92.95% <ø> (ø)
src/zarr/core/array.py 97.95% <100.00%> (+0.09%) ⬆️
src/zarr/testing/stateful.py 36.36% <0.00%> (+0.78%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paraseba
paraseba force-pushed the fix-from-array-keep-fill-value-attributes branch from fdb41f4 to 7b8b72e Compare August 26, 2026 04:25
`from_array` discards both `fill_value` and `attributes`.

An explicit `fill_value=None` now means the dtype's default scalar (v3) or a
null fill value (v2), consistent with `create_array`, and an empty
`attributes` dict opts out of copying the source's attributes.

Fixes zarr-developers#4287
@paraseba
paraseba force-pushed the fix-from-array-keep-fill-value-attributes branch from 95b0cf9 to b7decb5 Compare August 26, 2026 04:29
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.

from_array silently discards the source array's fill_value and attributes

1 participant