Skip to content

Commit cf003b5

Browse files
[tabulate] Allow DataFrame in tabulate tabular_data
1 parent 2e6650e commit cf003b5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎stubs/tabulate/tabulate/__init__.pyi‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Callable, Container, Iterable, Mapping, Sequence
23
from typing import Any, Final, Literal, NamedTuple, TypeAlias
34
from typing_extensions import Self
45

56
__all__ = ["tabulate", "tabulate_formats", "simple_separated_format"]
67

8+
# stub_uploader won't allow pandas-stubs in the requires field https://github.com/typeshed-internal/stub_uploader/issues/90
9+
# from pandas import DataFrame
10+
_DataFrame: TypeAlias = Incomplete
11+
712
__version__: Final[str]
813
# These constants are meant to be configurable
914
# https://github.com/astanin/python-tabulate#text-formatting
@@ -44,7 +49,7 @@ multiline_formats: dict[str, str]
4449
def simple_separated_format(separator: str) -> TableFormat: ...
4550
def tabulate(
4651
# The key is converted using str().
47-
tabular_data: Mapping[Any, Iterable[Any]] | Iterable[Iterable[Any]],
52+
tabular_data: Mapping[Any, Iterable[Any]] | Iterable[Iterable[Any]] | _DataFrame,
4853
headers: str | dict[str, str] | Sequence[str] = (),
4954
tablefmt: str | TableFormat = "simple",
5055
floatfmt: str | Iterable[str] = "g",

0 commit comments

Comments
 (0)