diff --git a/stubs/geopandas-stubs/_decorator.pyi b/stubs/geopandas-stubs/_decorator.pyi index de51a90..03f7f23 100644 --- a/stubs/geopandas-stubs/_decorator.pyi +++ b/stubs/geopandas-stubs/_decorator.pyi @@ -12,7 +12,7 @@ _Func = TypeVar("_Func", bound=_AnyCallable) # - docstring from the original function properly displayed (at least with Pylance) # Using the other overloads returns the signature of the decorated function instead @overload -def doc(func: _Func, /) -> Callable[[_AnyCallable], _Func]: ... +def doc(func: _Func, /, **params: object) -> Callable[[_AnyCallable], _Func]: ... @overload def doc(docstring: str, /, *docstrings: str | _AnyCallable, **params: object) -> Callable[[_Func], _Func]: ... @overload diff --git a/stubs/geopandas-stubs/geodataframe.pyi b/stubs/geopandas-stubs/geodataframe.pyi index 0852f5d..68f4a92 100644 --- a/stubs/geopandas-stubs/geodataframe.pyi +++ b/stubs/geopandas-stubs/geodataframe.pyi @@ -1,3 +1,4 @@ +import io import os from _typeshed import Incomplete, SupportsGetItem, SupportsRead, SupportsWrite from collections.abc import Callable, Hashable, Iterable, Iterator, Mapping @@ -227,18 +228,20 @@ class GeoDataFrame(GeoPandasBase, pd.DataFrame): # type: ignore[misc] # Keep method to_file roughly in line with GeoSeries.to_file def to_file( self, - # TODO verify SupportsWrite[Any] is correct and remove Incomplete - filename: str | os.PathLike[str] | SupportsWrite[Any] | Incomplete, + filename: str | os.PathLike[str] | io.BytesIO, driver: str | None = None, schema: dict[str, Any] | None = None, index: bool | None = None, *, + # kwargs from `_to_file` function mode: Literal["w", "a"] = "w", crs: _ConvertibleToCRS | None = None, engine: Literal["fiona", "pyogrio"] | None = None, + metadata: dict[str, str] | None = None, + # kwargs extracted from engines layer: int | str | None = None, encoding: str | None = None, - overwrite: bool | Incomplete = ..., # TODO can it be None? (accepted by fiona, not sure about pyogrio) + overwrite: bool | None = ..., **kwargs: Any, # engine and driver dependent ) -> None: ... @overload diff --git a/stubs/geopandas-stubs/geoseries.pyi b/stubs/geopandas-stubs/geoseries.pyi index 3570242..8cc7c6f 100644 --- a/stubs/geopandas-stubs/geoseries.pyi +++ b/stubs/geopandas-stubs/geoseries.pyi @@ -1,6 +1,7 @@ +import io import json import os -from _typeshed import Incomplete, SupportsRead, SupportsWrite, Unused +from _typeshed import SupportsRead, Unused from collections.abc import Callable, Hashable from typing import Any, Literal, final, overload from typing_extensions import Self, deprecated @@ -127,17 +128,20 @@ class GeoSeries(GeoPandasBase, pd.Series[BaseGeometry]): # type: ignore[type-va # Keep method to_file roughly in line with GeoDataFrame.to_file def to_file( self, - filename: str | os.PathLike[str] | SupportsWrite[Any] | Incomplete, + filename: str | os.PathLike[str] | io.BytesIO, driver: str | None = None, index: bool | None = None, *, + # kwargs from `_to_file` function schema: dict[str, Any] | None = None, mode: Literal["w", "a"] = "w", crs: _ConvertibleToCRS | None = None, engine: Literal["fiona", "pyogrio"] | None = None, + metadata: dict[str, str] | None = None, + # kwargs extracted from engines layer: int | str | None = None, encoding: str | None = None, - overwrite: bool | Incomplete = ..., # TODO can it be None? (accepted by fiona, not sure about pyogrio) + overwrite: bool | None = ..., **kwargs: Any, # engine and driver dependent ) -> None: ... # *** TODO: compare `__getitem__` with pandas-stubs ***