From ca6082ee06dea50e88151947e444482bcb0c1d9d Mon Sep 17 00:00:00 2001 From: AryanRG Date: Mon, 16 Nov 2026 18:38:14 +0530 Subject: [PATCH 1/2] Fix slice step offsets and empty bounds --- streamz/core.py | 5 +++-- streamz/tests/test_core.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/streamz/core.py b/streamz/core.py index 6d49d5a8..68db709e 100644 --- a/streamz/core.py +++ b/streamz/core.py @@ -1063,13 +1063,14 @@ def __init__(self, upstream, start=None, end=None, step=None, **kwargs): self._check_end() def update(self, x, who=None, metadata=None): - if self.state >= self.star and self.state % self.step == 0: + if (self.state >= self.star + and (self.state - self.star) % self.step == 0): self.emit(x, metadata=metadata) self.state += 1 self._check_end() def _check_end(self): - if self.end and self.state >= self.end: + if self.end is not None and self.state >= self.end: # we're done for upstream in self.upstreams: upstream._remove_downstream(self) diff --git a/streamz/tests/test_core.py b/streamz/tests/test_core.py index 67261255..aa32e36b 100644 --- a/streamz/tests/test_core.py +++ b/streamz/tests/test_core.py @@ -1753,7 +1753,9 @@ def test_share_common_ioloop(clean): # noqa: F811 [[1, None, None], [1, 2, 3, 4, 5]], [[None, 4, None], [0, 1, 2, 3]], [[None, 4, 2], [0, 2]], - [[3, 1, None], []] + [[3, 1, None], []], + [[1, None, 2], [1, 3, 5]], + [[None, 0, None], []], ]) def test_slice(data): From 5e717c5825fb9364ec276b6a4bfe2f32a0e7d241 Mon Sep 17 00:00:00 2001 From: AryanRG Date: Tue, 17 Nov 2026 14:02:17 +0530 Subject: [PATCH 2/2] Install Miniforge explicitly in CI --- .github/workflows/main.yaml | 8 +++++--- ci/environment-py310.yml | 1 - ci/environment-py311.yml | 1 - ci/environment-py312.yml | 1 - ci/environment-py313.yml | 1 - ci/environment-py314.yml | 1 - 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0fe83665..890d5e2c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -30,11 +30,13 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 + - name: Setup Miniforge + uses: conda-incubator/setup-miniconda@v4 with: + miniforge-version: latest auto-update-conda: true - auto-activate-base: false + auto-activate: false + conda-remove-defaults: true activate-environment: test_env environment-file: ci/environment-${{ matrix.CONDA_ENV }}.yml diff --git a/ci/environment-py310.yml b/ci/environment-py310.yml index 3dfa369a..2f18d715 100644 --- a/ci/environment-py310.yml +++ b/ci/environment-py310.yml @@ -1,7 +1,6 @@ name: test_env channels: - conda-forge - - defaults dependencies: - python=3.10 - pytest diff --git a/ci/environment-py311.yml b/ci/environment-py311.yml index 275fb62d..ece68610 100644 --- a/ci/environment-py311.yml +++ b/ci/environment-py311.yml @@ -1,7 +1,6 @@ name: test_env channels: - conda-forge - - defaults dependencies: - python=3.11 - pytest diff --git a/ci/environment-py312.yml b/ci/environment-py312.yml index 6de4e3b8..73b1a915 100644 --- a/ci/environment-py312.yml +++ b/ci/environment-py312.yml @@ -1,7 +1,6 @@ name: test_env channels: - conda-forge - - defaults dependencies: - python=3.12 - pytest diff --git a/ci/environment-py313.yml b/ci/environment-py313.yml index 66e06768..7e4e7639 100644 --- a/ci/environment-py313.yml +++ b/ci/environment-py313.yml @@ -1,7 +1,6 @@ name: test_env channels: - conda-forge - - defaults dependencies: - python=3.13 - pytest diff --git a/ci/environment-py314.yml b/ci/environment-py314.yml index 68b4ea71..ba8b8400 100644 --- a/ci/environment-py314.yml +++ b/ci/environment-py314.yml @@ -1,7 +1,6 @@ name: test_env channels: - conda-forge - - defaults dependencies: - python=3.14 - pytest