Skip to content

Commit ace646a

Browse files
committed
relax polars upper pin
1 parent 699ce4d commit ace646a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@
7777
"google-cloud-pubsub >=2.21.4",
7878
],
7979
# used for local engine
80-
# TODO(tswast): relax upper pin when issue with test_engines_astype_int
81-
# and test_divmods_series is resolved.
82-
"polars": ["polars >= 1.21.0, <1.34.0"],
80+
"polars": ["polars >= 1.21.0"],
8381
"scikit-learn": ["scikit-learn>=1.2.2"],
8482
# Packages required for basic development flow.
8583
"dev": [

tests/system/small/engines/test_generic_ops.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from bigframes.session import polars_executor
2323
from bigframes.testing.engine_utils import assert_equivalence_execution
2424

25-
pytest.importorskip("polars")
25+
polars = pytest.importorskip("polars")
2626

2727
# Polars used as reference as its fast and local. Generally though, prefer gbq engine where they disagree.
2828
REFERENCE_ENGINE = polars_executor.PolarsExecutor()
@@ -54,6 +54,12 @@ def apply_op(
5454

5555
@pytest.mark.parametrize("engine", ["polars", "bq", "bq-sqlglot"], indirect=True)
5656
def test_engines_astype_int(scalars_array_value: array_value.ArrayValue, engine):
57+
polars_version = tuple([int(part) for part in polars.__version__.split(".")])
58+
if polars_version >= (1, 34, 0):
59+
# TODO(https://github.com/pola-rs/polars/issues/24841): Remove this when
60+
# polars fixes Decimal to Int cast.
61+
scalars_array_value = scalars_array_value.drop_columns(["numeric_col"])
62+
5763
arr = apply_op(
5864
scalars_array_value,
5965
ops.AsTypeOp(to_type=bigframes.dtypes.INT_DTYPE),

0 commit comments

Comments
 (0)