Skip to content

fix: return empty list from chunk when size is less than 1 - #252

Merged
dgilland merged 1 commit into
dgilland:developfrom
santhreal:fix/chunk-size-zero
Jul 26, 2026
Merged

fix: return empty list from chunk when size is less than 1#252
dgilland merged 1 commit into
dgilland:developfrom
santhreal:fix/chunk-size-zero

Conversation

@santhreal

@santhreal santhreal commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

pydash.arrays.chunk hits ZeroDivisionError when size=0. This PR fixes the regression with a focused test covering the case.

chunk divided len(array) by size with no guard, so size=0 raised
ZeroDivisionError. Match lodash and return [] for size < 1.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — santhreal:fix/chunk-size-zero into dgilland:develop

@dgilland
dgilland merged commit e3e12e4 into dgilland:develop Jul 26, 2026
12 checks passed
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.

3 participants