diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b7974e5764100..e23c735fe41df 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -18,7 +18,6 @@ import itertools from textwrap import dedent from typing import ( - IO, TYPE_CHECKING, Any, Callable, @@ -2717,7 +2716,7 @@ def to_feather(self, path: FilePath | WriteBuffer[bytes], **kwargs) -> None: ) def to_markdown( self, - buf: IO[str] | str | None = None, + buf: FilePath | WriteBuffer[str] | None = None, mode: str = "wt", index: bool = True, storage_options: StorageOptions = None,