File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 1616
1717from __future__ import annotations
1818
19- try :
20- import anywidget # noqa
19+ from typing import Any
2120
22- from bigframes .display .anywidget import TableWidget
2321
24- __all__ = ["TableWidget" ]
25- except Exception :
26- pass
22+ def __getattr__ (name : str ) -> Any :
23+ if name == "TableWidget" :
24+ try :
25+ import anywidget # noqa
26+
27+ from bigframes .display .anywidget import TableWidget
28+
29+ return TableWidget
30+ except Exception :
31+ raise AttributeError (
32+ f"module '{ __name__ } ' has no attribute '{ name } '. "
33+ "TableWidget requires anywidget and traitlets to be installed. "
34+ "Please `pip install anywidget traitlets` or `pip install 'bigframes[anywidget]'`."
35+ )
36+ raise AttributeError (f"module '{ __name__ } ' has no attribute '{ name } '" )
37+
38+
39+ __all__ = ["TableWidget" ]
You can’t perform that action at this time.
0 commit comments