diff --git a/python/cudf_polars/cudf_polars/dsl/translate.py b/python/cudf_polars/cudf_polars/dsl/translate.py index 53e76ea6b89e..d9f2b03c3f74 100644 --- a/python/cudf_polars/cudf_polars/dsl/translate.py +++ b/python/cudf_polars/cudf_polars/dsl/translate.py @@ -301,9 +301,11 @@ def _drop_dyn_pred_hints( ): left = _drop_dyn_pred_hints(translator, node.left, schema) right = _drop_dyn_pred_hints(translator, node.right, schema) - if left is None: - return right # pragma: no cover - if right is None: + # Which branch is taken depends on where the dynamic predicate lands in + # the AND tree, which is nondeterministic. + if left is None: # pragma: no cover + return right + if right is None: # pragma: no cover return left return expr.BinOp( DataType(translator.visitor.get_dtype(n)), diff --git a/python/cudf_polars/tests/test_filter.py b/python/cudf_polars/tests/test_filter.py index 71781454e70d..113d82729b38 100644 --- a/python/cudf_polars/tests/test_filter.py +++ b/python/cudf_polars/tests/test_filter.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations