From b1585d5e00f9b18cd0a76fcf5f04461433628454 Mon Sep 17 00:00:00 2001 From: Mayoor Rao Date: Sat, 8 Nov 2025 08:58:37 -0800 Subject: [PATCH 1/2] Update import statement for IPython display --- ads/common/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c20f09ec462f218aca60c6dc30f4db2f786c0c42 Mon Sep 17 00:00:00 2001 From: Mayoor Rao Date: Sat, 8 Nov 2025 09:08:15 -0800 Subject: [PATCH 2/2] Refactor IPython traceback handling --- ads/common/ipython.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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