Repository navigation
Conversation
vsaraikin
force-pushed
the
str-accessor-dask-truncation
branch
from
December 1, 2026 08:28
fe23ed4 to
f08ec60
Compare
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.
Description
String accessor methods that return strings and still go elementwise (
cat,+,upper,format, regexreplace, ...) gave truncated results on dask arrays. There are two reasons. dask callsnp.vectorizewith a signature, which allocates aU1/S1output (numpy/numpy#8352), so these now use an object output on chunked data. And each chunk gets its own string width, but the chunks are concatenated with the dtype of the first one, so wider later chunks were cut. This also affected thenp.stringspath from #11746 when the first chunk is not the widest, e.g.da.chunk(1).str * 3. The new_astype_strcasts all chunks to the largest width.The computed result now has the same values and dtype as on numpy arrays. The cost is that the largest width needs all chunks, so they stay in memory until the last one is done. The alternative would be to return object arrays on dask and leave the width alone, I can change it to that if you prefer.
split/rsplitwithdim,extractallandget_dummiesstill fail on dask arrays. Their output size depends on the data, so I left them out.Checklist
whats-new.rstAI Disclosure