Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 815f663

Browse files
only import IPython when requesting extension load
1 parent 4a899ef commit 815f663

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bigframes/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from bigframes._config import option_context, options
1818
from bigframes._config.bigquery_options import BigQueryOptions
19-
from bigframes._magics import _cell_magic
2019
from bigframes.core.global_session import close_session, get_global_session
2120
import bigframes.enums as enums
2221
import bigframes.exceptions as exceptions
@@ -28,6 +27,9 @@
2827

2928
def load_ipython_extension(ipython):
3029
"""Called by IPython when this module is loaded as an IPython extension."""
30+
# Requires IPython to be installed for import to succeed
31+
from bigframes._magics import _cell_magic
32+
3133
for magic_name in _MAGIC_NAMES:
3234
ipython.register_magic_function(
3335
_cell_magic, magic_kind="cell", magic_name=magic_name

0 commit comments

Comments
 (0)