Skip to content

Fix slice step offsets and empty bounds - #505

Merged
martindurant merged 2 commits into
python-streamz:masterfrom
AryanRG:fix-slice-offset-empty-end
Nov 17, 2026
Merged

martindurant merged 2 commits into
python-streamz:masterfrom
AryanRG:fix-slice-offset-empty-end

Conversation

@AryanRG

@AryanRG AryanRG commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Stream.slice(1, None, 2) currently emits items at indices 2, 4, 6 instead of 1, 3, 5. It also treats end=0 as an unbounded slice.

This counts the step from start and handles zero as an explicit end. Two cases extend the existing slice test, one for each bug.

The new cases fail on the original code. With the fix, the core suite passes with 125 passed and 2 skipped, and flake8 passes. Independent review also checked slicing boundaries, detachment and metadata reference counts. Other test modules were not run.

Prepared with AI assistance.

@martindurant

Copy link
Copy Markdown
Member

Apparently the CI setup needs to be refreshed.

@AryanRG

AryanRG commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @martindurant. Updated CI to install Miniforge explicitly with setup-miniconda@v4 and use conda-forge. Linux dependency dry-runs passed for all five Python versions, and the core tests pass locally (125 passed, 2 skipped). The new CI run is waiting for approval.

@martindurant
martindurant merged commit a447942 into python-streamz:master Nov 17, 2026
6 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.

2 participants