Skip to content

Commit f593bb7

Browse files
fix(display): Update display import (#1709)
* fix: improve type checking logic in _is_cast_type_defined function * fix: update IPython import paths to use the correct module * Revert "fix: improve type checking logic in _is_cast_type_defined function" This reverts commit 65e424c. --------- Co-authored-by: Fabiana <[email protected]>
1 parent 0ed32b7 commit f593bb7

File tree

8 files changed

+19
-12
lines changed

8 files changed

+19
-12
lines changed

src/ydata_profiling/profile_report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def to_notebook_iframe(self) -> None:
509509
Notes:
510510
This constructions solves problems with conflicting stylesheets and navigation links.
511511
"""
512-
from IPython.core.display import display
512+
from IPython.display import display
513513

514514
from ydata_profiling.report.presentation.flavours.widget.notebook import (
515515
get_notebook_iframe,
@@ -532,7 +532,7 @@ def to_widgets(self) -> None:
532532
except ModuleNotFoundError:
533533
pass
534534

535-
from IPython.core.display import display
535+
from IPython.display import display
536536

537537
display(self.widgets)
538538

src/ydata_profiling/report/presentation/flavours/widget/correlation_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from IPython.core.display import display
1+
from IPython.display import display
22
from ipywidgets import Output, widgets
33

44
from ydata_profiling.report.presentation.core.correlation_table import CorrelationTable

src/ydata_profiling/report/presentation/flavours/widget/duplicate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from IPython.core.display import display
1+
from IPython.display import display
22
from ipywidgets import Output, widgets
33

44
from ydata_profiling.report.presentation.core.duplicate import Duplicate

src/ydata_profiling/report/presentation/flavours/widget/notebook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import TYPE_CHECKING, Union
66

77
if TYPE_CHECKING:
8-
from IPython.core.display import HTML
8+
from IPython.display import HTML
99
from IPython.lib.display import IFrame
1010

1111
from ydata_profiling import ProfileReport
@@ -22,7 +22,7 @@ def get_notebook_iframe_srcdoc(config: Settings, profile: ProfileReport) -> "HTM
2222
Returns:
2323
IPython HTML object.
2424
"""
25-
from IPython.core.display import HTML
25+
from IPython.display import HTML
2626

2727
width = config.notebook.iframe.width
2828
height = config.notebook.iframe.height

src/ydata_profiling/report/presentation/flavours/widget/sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from IPython.core.display import display
1+
from IPython.display import display
22
from ipywidgets import Output, widgets
33

44
from ydata_profiling.report.presentation.core.sample import Sample

src/ydata_profiling/utils/notebook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
def full_width() -> None:
55
"""Resize the notebook to use it's full width"""
6-
from IPython.core.display import HTML, display
6+
from IPython.display import HTML, display
77

88
display(HTML("<style>.container { width:100% !important; }</style>"))

tests/notebooks/meteorites.ipynb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
"df = pd.concat([df, duplicates_to_add], ignore_index=True)"
6161
]
6262
},
63+
{
64+
"cell_type": "code",
65+
"execution_count": null,
66+
"metadata": {},
67+
"outputs": [],
68+
"source": []
69+
},
6370
{
6471
"cell_type": "code",
6572
"execution_count": null,
@@ -77,7 +84,7 @@
7784
" display(pr)\n",
7885
"\n",
7986
"assert len(out.outputs) == 2\n",
80-
"assert out.outputs[0].data[\"text/plain\"] == \"<IPython.core.display.HTML object>\"\n",
87+
"assert out.outputs[0].data[\"text/plain\"] == \"<IPython.display.HTML object>\"\n",
8188
"assert out.outputs[1].data[\"text/plain\"] == \"\""
8289
]
8390
},
@@ -129,7 +136,7 @@
129136
" display(pfr)\n",
130137
"\n",
131138
"assert len(out.outputs) == 2\n",
132-
"assert out.outputs[0].data[\"text/plain\"] == \"<IPython.core.display.HTML object>\"\n",
139+
"assert out.outputs[0].data[\"text/plain\"] == \"<IPython.display.HTML object>\"\n",
133140
"assert out.outputs[1].data[\"text/plain\"] == \"\""
134141
]
135142
}

tests/notebooks/titanic.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"\n",
9494
"# assert len(out.outputs) == 2\n",
9595
"# assert out.outputs[0].data['text/plain'].startswith('Tab(children=(HTML(value=')\n",
96-
"# assert out.outputs[1].data['text/plain'] == '<IPython.core.display.HTML object>'\n",
96+
"# assert out.outputs[1].data['text/plain'] == '<IPython.display.HTML object>'\n",
9797
"# assert 'ydata-profiling' in out.outputs[1].data['text/html']"
9898
]
9999
},
@@ -108,7 +108,7 @@
108108
" profile.to_notebook_iframe()\n",
109109
"\n",
110110
"assert len(out.outputs) == 1\n",
111-
"assert out.outputs[0].data[\"text/plain\"] == \"<IPython.core.display.HTML object>\""
111+
"assert out.outputs[0].data[\"text/plain\"] == \"<IPython.display.HTML object>\""
112112
]
113113
}
114114
],

0 commit comments

Comments
 (0)