Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* Improve error output for master discovery
* Make `ClusterCommandsProtocol` an actual Protocol
* Add `sum` to DUPLICATE_POLICY documentation of `TS.CREATE`, `TS.ADD` and `TS.ALTER`
* Prevent async ClusterPipeline instances from becoming "false-y" in case of empty command stack (#3061)

* 4.1.3 (Feb 8, 2022)
* Fix flushdb and flushall (#1926)
Expand Down
3 changes: 2 additions & 1 deletion redis/asyncio/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,8 @@ def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None:
self._command_stack = []

def __bool__(self) -> bool:
return bool(self._command_stack)
"Pipeline instances should always evaluate to True on Python 3+"
return True

def __len__(self) -> int:
return len(self._command_stack)
Expand Down
1 change: 0 additions & 1 deletion tests/test_asyncio/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestPipeline:
@pytest.mark.onlynoncluster
async def test_pipeline_is_true(self, r):
"""Ensure pipeline instances are not false-y"""
async with r.pipeline() as pipe:
Expand Down