diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 54711473c1f5d..e6f9503a1e6f2 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -231,7 +231,7 @@ def __init__( thousands=thousands, ) - def _repr_html_(self) -> str: + def _repr_html_(self) -> str | None: """ Hooks into Jupyter notebook rich display system, which calls _repr_html_ by default if an object is returned at the end of a cell. @@ -240,7 +240,7 @@ def _repr_html_(self) -> str: return self.to_html() return None - def _repr_latex_(self) -> str: + def _repr_latex_(self) -> str | None: if get_option("styler.render.repr") == "latex": return self.to_latex() return None