From 1ebd039dab34a3b13f45fb445ad0757de37b2337 Mon Sep 17 00:00:00 2001 From: Luke Manley Date: Wed, 1 Jan 2025 07:07:21 -0500 Subject: [PATCH] docs: Fix flaky doctests (#20516) --- py-polars/polars/expr/expr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index 80e4c9ae9559..d0e94dd2f454 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -10561,15 +10561,15 @@ def bitwise_and(self) -> Expr: >>> df = pl.DataFrame( ... {"grouper": ["a", "a", "a", "b", "b"], "n": [-1, 0, 1, -1, 1]} ... ) - >>> df.group_by("grouper").agg(pl.col("n").bitwise_and()) + >>> df.group_by("grouper", maintain_order=True).agg(pl.col("n").bitwise_and()) shape: (2, 2) ┌─────────┬─────┐ │ grouper ┆ n │ │ --- ┆ --- │ │ str ┆ i64 │ ╞═════════╪═════╡ - │ b ┆ 1 │ │ a ┆ 0 │ + │ b ┆ 1 │ └─────────┴─────┘ """ return self._from_pyexpr(self._pyexpr.bitwise_and()) @@ -10592,7 +10592,7 @@ def bitwise_or(self) -> Expr: >>> df = pl.DataFrame( ... {"grouper": ["a", "a", "a", "b", "b"], "n": [-1, 0, 1, -1, 1]} ... ) - >>> df.group_by("grouper").agg(pl.col("n").bitwise_or()) + >>> df.group_by("grouper", maintain_order=True).agg(pl.col("n").bitwise_or()) shape: (2, 2) ┌─────────┬─────┐ │ grouper ┆ n │ @@ -10623,7 +10623,7 @@ def bitwise_xor(self) -> Expr: >>> df = pl.DataFrame( ... {"grouper": ["a", "a", "a", "b", "b"], "n": [-1, 0, 1, -1, 1]} ... ) - >>> df.group_by("grouper").agg(pl.col("n").bitwise_xor()) + >>> df.group_by("grouper", maintain_order=True).agg(pl.col("n").bitwise_xor()) shape: (2, 2) ┌─────────┬─────┐ │ grouper ┆ n │