Skip to content

Commit dd93d48

Browse files
authored
CI: run stubtest (#178)
* CI: run stubtest * maybe fix windows bug? * remove allowlist * isort * remove non-existing files * slightly nicer solution? * fix most default arguments * remove very few of the many non-existing things * read_json
1 parent 257e761 commit dd93d48

25 files changed

+54
-94
lines changed

docs/tests.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ Here are the most important options. Fore more details, please use `poe --help`.
1111
- Run only pytest: `poe pytest`
1212
- Run only pre-commit: `poe style`
1313
- Run tests against the installed stubs (this will install and uninstall the stubs): `poe test_dist`
14+
- Optional: Run stubtest to compare the installed pandas-stubs against pandas (this will fail): `poe stubtest`. If you have created an allowlist to ignore certain errors: `poe stubtest path_to_the_allow_list`
1415

1516
These tests originally came from https://github.com/VirtusLab/pandas-stubs.

pandas-stubs/core/arrays/_arrow_utils.pyi

Whitespace-only changes.

pandas-stubs/core/arrays/categorical.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ class Categorical(ExtensionArray, PandasObject):
6767
@overload
6868
def set_ordered(self, value, inplace: Literal[True]) -> None: ...
6969
@overload
70-
def set_ordered(self, value, inplace: Literal[False]) -> Categorical: ...
70+
def set_ordered(self, value, inplace: Literal[False] = ...) -> Categorical: ...
7171
@overload
72-
def set_ordered(self, value, inplace: bool) -> Categorical | None: ...
72+
def set_ordered(self, value, inplace: bool = ...) -> Categorical | None: ...
7373
@overload
7474
def as_ordered(self, inplace: Literal[True]) -> None: ...
7575
@overload
76-
def as_ordered(self, inplace: Literal[False]) -> Categorical: ...
76+
def as_ordered(self, inplace: Literal[False] = ...) -> Categorical: ...
7777
@overload
78-
def as_ordered(self, inplace: bool) -> Categorical | None: ...
78+
def as_ordered(self, inplace: bool = ...) -> Categorical | None: ...
7979
@overload
8080
def as_unordered(self, inplace: Literal[True]) -> None: ...
8181
@overload
@@ -155,7 +155,7 @@ class Categorical(ExtensionArray, PandasObject):
155155
def __ge__(self, other) -> bool: ...
156156
@property
157157
def shape(self): ...
158-
def shift(self, periods, fill_value=...): ...
158+
def shift(self, periods=..., fill_value=...): ...
159159
def __array__(self, dtype=...) -> np.ndarray: ...
160160
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
161161
@property
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def set_use_numexpr(v: bool = ...) -> None: ...
22
def set_numexpr_threads(n=...) -> None: ...
3-
def evaluate(op, op_str, a, b, use_numexpr: bool = ...): ...
3+
def evaluate(op, a, b, use_numexpr: bool = ...): ...
44
def where(cond, a, b, use_numexpr: bool = ...): ...
55
def set_test_mode(v: bool = ...) -> None: ...
66
def get_test_result(): ...

pandas-stubs/core/computation/ops.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22

33
class UndefinedVariableError(NameError):
4-
def __init__(self, name, is_local: bool) -> None: ...
4+
def __init__(self, name, is_local: bool = ...) -> None: ...
55

66
class Term:
77
def __new__(cls, name, env, side=..., encoding=...): ...

pandas-stubs/core/frame.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ class DataFrame(NDFrame, OpsMixin):
12911291
fill_value: float | None = ...,
12921292
) -> DataFrame: ...
12931293
def droplevel(
1294-
self, level: Level | list[Level] = ..., axis: AxisType = ...
1294+
self, level: Level | list[Level], axis: AxisType = ...
12951295
) -> DataFrame: ...
12961296
def eq(
12971297
self, other, axis: AxisType = ..., level: Level | None = ...

pandas-stubs/core/indexes/base.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Index(IndexOpsMixin, PandasObject):
191191
def map(self, mapper, na_action=...) -> Index: ...
192192
def isin(self, values, level=...) -> np_ndarray_bool: ...
193193
def slice_indexer(self, start=..., end=..., step=..., kind=...): ...
194-
def get_slice_bound(self, label, side, kind): ...
194+
def get_slice_bound(self, label, side, kind=...): ...
195195
def slice_locs(self, start=..., end=..., step=..., kind=...): ...
196196
def delete(self, loc): ...
197197
def insert(self, loc, item): ...

pandas-stubs/core/indexes/category.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CategoricalIndex(ExtensionIndex, accessor.PandasDelegate):
2525
def __contains__(self, key) -> bool: ...
2626
def __array__(self, dtype=...) -> np.ndarray: ...
2727
def astype(self, dtype: DtypeArg, copy: bool = ...) -> Index: ...
28-
def fillna(self, value, downcast=...): ...
28+
def fillna(self, value=..., downcast=...): ...
2929
def is_unique(self) -> bool: ...
3030
@property
3131
def is_monotonic_increasing(self) -> bool: ...

pandas-stubs/core/indexes/multi.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class MultiIndex(Index):
117117
def get_indexer_non_unique(self, target): ...
118118
def reindex(self, target, method=..., level=..., limit=..., tolerance=...): ...
119119
def get_slice_bound(
120-
self, label: Hashable | Sequence[Hashable], side: str, kind: str
120+
self, label: Hashable | Sequence[Hashable], side: str, kind: str = ...
121121
) -> int: ...
122122
def slice_locs(self, start=..., end=..., step=..., kind=...): ...
123123
def get_loc(self, key, method=...): ...

pandas-stubs/core/ops/roperator.pyi

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)