From 2c35bae5e74b39d0ec7fa6dd1fa8d1866eaa7246 Mon Sep 17 00:00:00 2001 From: Alex Povel Date: Thu, 3 Mar 2022 17:22:16 +0100 Subject: [PATCH] TYP: loosen types of to_markdown, align to docs Docs already allowed pathlib.Path objects and such code runs, but failed mypy typechecks. This fixes it. --- pandas/core/frame.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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,