diff --git a/ads/common/ipython.py b/ads/common/ipython.py index 36b548d3b..9b26d8a1d 100644 --- a/ads/common/ipython.py +++ b/ads/common/ipython.py @@ -63,14 +63,12 @@ def configure_plotting(): try: import IPython - + shell = IPython.get_ipython() global orig_ipython_traceback - if IPython.core.interactiveshell.InteractiveShell.showtraceback != _log_traceback: - orig_ipython_traceback = ( - IPython.core.interactiveshell.InteractiveShell.showtraceback - ) + if shell.showtraceback != _log_traceback: + orig_ipython_traceback = shell.showtraceback # Override the default showtraceback behavior of ipython, to show only the error message and log the stacktrace - IPython.core.interactiveshell.InteractiveShell.showtraceback = _log_traceback + shell.showtraceback = _log_traceback except ModuleNotFoundError: pass diff --git a/ads/common/model.py b/ads/common/model.py index bfee5384f..21d1c07f1 100644 --- a/ads/common/model.py +++ b/ads/common/model.py @@ -640,7 +640,7 @@ def show_in_notebook(self): "display.precision", 4, ): - from IPython.core.display import HTML, display + from IPython.display import HTML, display display(HTML(info_df.to_html(index=False, header=False))) return info