Skip to content

Commit 23877c6

Browse files
committed
use WIDGET_BASE
1 parent 701c05e commit 23877c6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bigframes/display/anywidget.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from importlib import resources
1818
import functools
1919
import math
20-
from typing import Any, Dict, Iterator, TYPE_CHECKING
20+
from typing import Any, Dict, Iterator, Type, TYPE_CHECKING
2121
import uuid
2222

2323
import pandas as pd
@@ -35,8 +35,14 @@
3535
except Exception:
3636
ANYWIDGET_INSTALLED = False
3737

38+
WIDGET_BASE: Type[Any]
39+
if ANYWIDGET_INSTALLED:
40+
WIDGET_BASE = anywidget.AnyWidget
41+
else:
42+
WIDGET_BASE = object
43+
3844

39-
class TableWidget(anywidget.AnyWidget):
45+
class TableWidget(WIDGET_BASE):
4046
"""
4147
An interactive, paginated table widget for BigFrames DataFrames.
4248
"""

0 commit comments

Comments
 (0)