Repository navigation
Conversation
estimate_chunksize used a zero-length axis as its chunk size, so views of an Unchunked disk array with an empty range, e.g. Array(view(a, :, 1:0)), threw "Chunk sizes must be strictly positive". Broadcasting over unchunked arrays fell back to one chunk spanning the array, of size 0 along an empty axis, so e.g. convert(Vector, a) of an empty one threw the same. Fixes JuliaIO#292
Beforerr
force-pushed
the
fix-estimate-chunksize-zero
branch
from
October 26, 2026 05:18
9a97c8d to
7208470
Compare
This was referenced Oct 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Disk arrays with an empty axis cannot be read when DiskArrays picks their chunks itself:
This shows up in practice with selections that match no records.
Root cause
Two places use an axis length as the chunk size, so an empty axis gets chunk size 0 and
RegularChunksrejects it:estimate_chunksize, whicheachchunkof such a view falls back to (alsoeachchunk(zeros(3, 0)), eachchunkof zero dimensional array should work #292);common_chunks, which gives broadcasts over only unchunked arrays one chunk spanning the array.This is the zero chunk size discussed in #220, but produced by DiskArrays itself rather than by a backend's
eachchunkfallback.Fix
Clamp both to at least 1, as
RegularChunks(max(s, 1), 0, s)is recommended for backends.Fixes #292