Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions pandas-stubs/core/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from collections.abc import (
Hashable,
Iterable,
Mapping,
MutableMapping,
Sequence,
)
import datetime as dt
Expand Down Expand Up @@ -162,20 +163,21 @@ class NDFrame(indexing.IndexingMixin):
self,
name: _str,
con: str | sqlalchemy.engine.Connectable | sqlite3.Connection,
schema: _str | None = ...,
if_exists: Literal["fail", "replace", "append"] = "fail",
*,
schema: _str | None = None,
if_exists: Literal["fail", "replace", "append", "delete_rows"] = "fail",
index: _bool = True,
index_label: IndexLabel = None,
chunksize: int | None = ...,
dtype: DtypeArg | None = ...,
chunksize: int | None = None,
dtype: DtypeArg | None = None,
method: (
Literal["multi"]
| Callable[
[SQLTable, Any, list[str], Iterable[tuple[Any, ...]]],
int | None,
]
| None
) = ...,
) = None,
) -> int | None: ...
@final
def to_pickle(
Expand Down Expand Up @@ -442,7 +444,7 @@ class NDFrame(indexing.IndexingMixin):
@final
def __copy__(self, deep: _bool = ...) -> Self: ...
@final
def __deepcopy__(self, memo=...) -> Self: ...
def __deepcopy__(self, memo: MutableMapping[int, Any] | None = None) -> Self: ...
@final
def convert_dtypes(
self,
Expand Down
3 changes: 2 additions & 1 deletion pandas-stubs/core/indexes/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from collections.abc import (
Callable,
Hashable,
Iterable,
MutableMapping,
Sequence,
)
from datetime import (
Expand Down Expand Up @@ -346,7 +347,7 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]):
@final
def __copy__(self, **kwargs: Any): ...
@final
def __deepcopy__(self, memo=...): ...
def __deepcopy__(self, memo: MutableMapping[int, Any] | None = None) -> Self: ...
def format(
self, name: bool = ..., formatter: Callable | None = ..., na_rep: _str = ...
) -> list[_str]: ...
Expand Down
3 changes: 2 additions & 1 deletion pandas-stubs/io/formats/style.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import (
Callable,
MutableMapping,
Sequence,
)
from typing import (
Expand Down Expand Up @@ -224,7 +225,7 @@ class Styler(StylerRenderer):
) -> str: ...
def set_td_classes(self, classes: DataFrame) -> Styler: ...
def __copy__(self) -> Styler: ...
def __deepcopy__(self, memo) -> Styler: ...
def __deepcopy__(self, memo: MutableMapping[int, Any] | None) -> Styler: ...
def clear(self) -> None: ...
@overload
def apply(
Expand Down
5 changes: 3 additions & 2 deletions pandas-stubs/io/pytables.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ from pandas.core.generic import NDFrame
from typing_extensions import Self

from pandas._typing import (
BaseBuffer,
FilePath,
HashableT,
HashableT1,
Expand Down Expand Up @@ -101,7 +102,7 @@ def read_hdf(
class HDFStore:
def __init__(
self,
path,
path: FilePath | BaseBuffer,
mode: Literal["a", "w", "r", "r+"] = ...,
complevel: int | None = ...,
complib: HDFCompLib | None = ...,
Expand All @@ -122,7 +123,7 @@ class HDFStore:
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None: ...
def keys(self, include="pandas") -> list[str]: ...
def keys(self, include: Literal["pandas", "native"] = "pandas") -> list[str]: ...
def __iter__(self) -> Iterator[str]: ...
def close(self) -> None: ...
@property
Expand Down
8 changes: 7 additions & 1 deletion pandas-stubs/io/sas/sasreader.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ from abc import (
abstractmethod,
)
from collections.abc import Hashable
from types import TracebackType
from typing import (
Literal,
overload,
Expand All @@ -26,7 +27,12 @@ class ReaderBase(metaclass=ABCMeta):
@abstractmethod
def close(self) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def __exit__(
self,
exc_type: type[BaseException] | None,
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None: ...

@overload
def read_sas(
Expand Down
37 changes: 19 additions & 18 deletions pandas-stubs/io/sql.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ from pandas._typing import (
DtypeArg,
DtypeBackend,
Scalar,
SequenceNotStr,
npt,
)

Expand Down Expand Up @@ -147,19 +148,19 @@ class PandasSQL:
self,
frame: DataFrame,
name: str,
if_exists: Literal["fail", "replace", "append"] = ...,
index: bool = ...,
index_label=...,
schema: str | None = ...,
chunksize=...,
dtype: DtypeArg | None = ...,
if_exists: Literal["fail", "replace", "append", "delete_rows"] = "fail",
index: bool = True,
index_label: str | SequenceNotStr[str] | None = None,
schema: str | None = None,
chunksize: int | None = None,
dtype: DtypeArg | None = None,
method: (
Literal["multi"]
| Callable[[SQLTable, Any, list[str], Iterable], int | None]
| None
) = ...,
engine: str = ...,
**engine_kwargs: dict[str, Any] | None,
) = None,
engine: str = "auto",
**engine_kwargs: Any,
) -> int | None: ...

class SQLTable:
Expand All @@ -169,22 +170,22 @@ class SQLTable:
frame: DataFrame | None
index: list[str]
schema: str
if_exists: Literal["fail", "replace", "append"]
if_exists: Literal["fail", "replace", "append", "delete_rows"]
keys: list[str]
dtype: DtypeArg | None
table: Any # sqlalchemy.Table
def __init__(
self,
name: str,
pandas_sql_engine: PandasSQL,
frame: DataFrame | None = ...,
index: bool | str | list[str] | None = ...,
if_exists: Literal["fail", "replace", "append"] = ...,
prefix: str = ...,
index_label: str | list[str] | None = ...,
schema: str | None = ...,
keys: str | list[str] | None = ...,
dtype: DtypeArg | None = ...,
frame: DataFrame | None = None,
index: bool | str | list[str] | None = True,
if_exists: Literal["fail", "replace", "append", "delete_rows"] = "fail",
prefix: str = "pandas",
index_label: str | list[str] | None = None,
schema: str | None = None,
keys: str | list[str] | None = None,
dtype: DtypeArg | None = None,
) -> None: ...
def exists(self) -> bool: ...
def sql_schema(self) -> str: ...
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/plotting/_core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ from matplotlib.colors import Colormap
from matplotlib.lines import Line2D
import numpy as np
import pandas as pd
from pandas import Series
from pandas.core.frame import DataFrame
from pandas.core.series import Series
from scipy.stats import gaussian_kde

from pandas._typing import (
Expand Down Expand Up @@ -85,7 +85,7 @@ def boxplot(
) -> _BoxPlotT: ...

class PlotAccessor:
def __init__(self, data) -> None: ...
def __init__(self, data: Series | DataFrame) -> None: ...
@overload
def __call__(
self,
Expand Down
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,6 @@ ignore = [
# TODO: remove when computations are fully typed
"ANN001", "ANN201", "ANN204", "ANN206",
]
"*plotting*" = [
# TODO: remove when plottings are fully typed
"ANN001", "ANN201", "ANN204", "ANN206",
]
"*io*" = [
# TODO: remove when io is fully typed
"ANN001", "ANN201", "ANN204", "ANN206",
]
"*window*" = [
# TODO: remove when window is fully typed
"ANN001", "ANN201", "ANN204", "ANN206",
Expand Down