Skip to content

Commit 7c19d8b

Browse files
committed
skip polars test for old polars
1 parent 6372a23 commit 7c19d8b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

bigframes/core/compile/polars/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@
2626
import bigframes.core.compile.polars.operations.generic_ops # noqa: F401
2727

2828
try:
29-
import polars # noqa
29+
import bigframes._importing
30+
31+
# Use import_polars() instead of importing directly so that we check the
32+
# version numbers.
33+
bigframes._importing.import_polars()
3034

3135
from bigframes.core.compile.polars.compiler import PolarsCompiler
3236

3337
__all__ = ["PolarsCompiler"]
3438
except Exception as exc:
35-
msg = (
36-
f"Polars compiler not available as polars is not installed. Details: {str(exc)}"
37-
)
39+
msg = f"Polars compiler not available as there was an exception importing polars. Details: {str(exc)}"
3840
warnings.warn(msg)

bigframes/core/compile/polars/compiler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@
4242
import polars as pl
4343
else:
4444
try:
45-
import polars as pl
45+
import bigframes._importing
46+
47+
# Use import_polars() instead of importing directly so that we check
48+
# the version numbers.
49+
pl = bigframes._importing.import_polars()
4650
except Exception:
4751
polars_installed = False
4852

0 commit comments

Comments
 (0)