File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2- # -*- coding: utf-8; -*-
32
4- # Copyright (c) 2022 Oracle and/or its affiliates.
3+ # Copyright (c) 2022, 2026 Oracle and/or its affiliates.
54# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
65
76import logging
@@ -64,13 +63,13 @@ def configure_plotting():
6463try :
6564 import IPython
6665
67- global orig_ipython_traceback
68- if IPython . core . interactiveshell . InteractiveShell . showtraceback != _log_traceback :
69- orig_ipython_traceback = (
70- IPython . core . interactiveshell . InteractiveShell . showtraceback
71- )
66+ shell = IPython . get_ipython ()
67+ if shell is not None :
68+ global orig_ipython_traceback
69+ if shell . showtraceback != _log_traceback :
70+ orig_ipython_traceback = shell . showtraceback
7271
73- # Override the default showtraceback behavior of ipython, to show only the error message and log the stacktrace
74- IPython . core . interactiveshell . InteractiveShell .showtraceback = _log_traceback
72+ # Override the default showtraceback behavior of ipython, to show only the error message and log the stacktrace
73+ shell .showtraceback = _log_traceback
7574except ModuleNotFoundError :
7675 pass
Original file line number Diff line number Diff line change @@ -633,10 +633,8 @@ def show_in_notebook(self):
633633 "display.precision" ,
634634 4 ,
635635 ):
636- from IPython .display import HTML
637-
636+ from IPython .display import HTML , display
638637 from ads .common .utils import get_display
639-
640638 display = get_display ()
641639 display (HTML (info_df .to_html (index = False , header = False )))
642640 return info
You can’t perform that action at this time.
0 commit comments