|
| 1 | +from _typeshed import Incomplete |
1 | 2 | from collections.abc import Callable, Container, Iterable, Mapping, Sequence |
2 | 3 | from typing import Any, Final, Literal, NamedTuple, TypeAlias |
3 | 4 | from typing_extensions import Self |
4 | 5 |
|
5 | 6 | __all__ = ["tabulate", "tabulate_formats", "simple_separated_format"] |
6 | 7 |
|
| 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 | + |
7 | 12 | __version__: Final[str] |
8 | 13 | # These constants are meant to be configurable |
9 | 14 | # https://github.com/astanin/python-tabulate#text-formatting |
@@ -44,7 +49,7 @@ multiline_formats: dict[str, str] |
44 | 49 | def simple_separated_format(separator: str) -> TableFormat: ... |
45 | 50 | def tabulate( |
46 | 51 | # 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, |
48 | 53 | headers: str | dict[str, str] | Sequence[str] = (), |
49 | 54 | tablefmt: str | TableFormat = "simple", |
50 | 55 | floatfmt: str | Iterable[str] = "g", |
|
0 commit comments