File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
bigframes/core/compile/polars Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 2626import bigframes .core .compile .polars .operations .generic_ops # noqa: F401
2727
2828try :
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" ]
3438except 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 )
Original file line number Diff line number Diff line change 4242 import polars as pl
4343else :
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
You can’t perform that action at this time.
0 commit comments