Skip to content

Commit fdda5a6

Browse files
authored
Delete undocumented functions (#1254)
* delete undocumented functions * delete empty files, revert unchanged files * format * clean up tests for deleted functions * precommit * delete some more functions/files per commetns * restore scopes.pyi * add back arrow/dtype and expr
1 parent 5532e9e commit fdda5a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+249
-490
lines changed

pandas-stubs/_libs/ops_dispatch.pyi

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
from datetime import datetime
2-
3-
def localize_pydatetime(dt: datetime, tz: object) -> datetime: ...
4-
51
class OutOfBoundsTimedelta(ValueError): ...

pandas-stubs/_libs/tslibs/parsing.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
from typing import Any
2-
3-
def parse_time_string(*args, **kwargs) -> Any: ...
4-
51
class DateParseError(ValueError):
62
def __init__(self, *args, **kwargs) -> None: ...

pandas-stubs/_libs/tslibs/strptime.pyi

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

pandas-stubs/_version.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ from typing import Literal
22

33
version_json: str = ...
44

5-
def get_versions(): ...
6-
75
_stub_version: Literal["2.2.3.250527"]

pandas-stubs/api/types/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ from pandas._libs.lib import infer_dtype as infer_dtype
22

33
from pandas.core.dtypes.api import (
44
is_any_real_numeric_dtype as is_any_real_numeric_dtype,
5-
is_array_like as is_array_like,
65
is_bool as is_bool,
76
is_bool_dtype as is_bool_dtype,
87
is_complex as is_complex,

pandas-stubs/core/arraylike.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ from typing import Any
22

33
from typing_extensions import Self
44

5-
from pandas._libs.ops_dispatch import (
6-
maybe_dispatch_ufunc_to_dunder_op as maybe_dispatch_ufunc_to_dunder_op,
7-
)
8-
95
class OpsMixin:
106
def __eq__(self, other: object) -> Self: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
117
def __ne__(self, other: object) -> Self: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import pyarrow as pa
2-
3-
from pandas._libs.missing import NAType
4-
5-
from pandas.core.dtypes.base import StorageExtensionDtype
6-
7-
class ArrowDtype(StorageExtensionDtype):
8-
pyarrow_dtype: pa.DataType
9-
def __init__(self, pyarrow_dtype: pa.DataType) -> None: ...
10-
@property
11-
def na_value(self) -> NAType: ...
1+
import pyarrow as pa
2+
3+
from pandas._libs.missing import NAType
4+
5+
from pandas.core.dtypes.base import StorageExtensionDtype
6+
7+
class ArrowDtype(StorageExtensionDtype):
8+
pyarrow_dtype: pa.DataType
9+
def __init__(self, pyarrow_dtype: pa.DataType) -> None: ...
10+
@property
11+
def na_value(self) -> NAType: ...

pandas-stubs/core/arrays/boolean.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ class BooleanDtype(ExtensionDtype):
1212
@classmethod
1313
def construct_array_type(cls) -> type_t[BooleanArray]: ...
1414

15-
def coerce_to_array(values, mask=..., copy: bool = ...): ...
16-
1715
class BooleanArray(BaseMaskedArray):
1816
def __init__(
1917
self, values: np.ndarray, mask: np.ndarray, copy: bool = ...

pandas-stubs/core/arrays/categorical.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,3 @@ class CategoricalAccessor(PandasDelegate, NoNewAttributesMixin):
157157
) -> Series: ...
158158
def as_ordered(self) -> Series: ...
159159
def as_unordered(self) -> Series: ...
160-
161-
def factorize_from_iterable(values): ...
162-
def factorize_from_iterables(iterables): ...

pandas-stubs/core/arrays/datetimelike.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,3 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
103103
def min(self, *, axis=..., skipna: bool = ..., **kwargs): ...
104104
def max(self, *, axis=..., skipna: bool = ..., **kwargs): ...
105105
def mean(self, *, skipna: bool = ...): ...
106-
107-
def maybe_infer_freq(freq): ...

pandas-stubs/core/arrays/datetimes.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ from pandas._typing import (
1515

1616
from pandas.core.dtypes.dtypes import DatetimeTZDtype as DatetimeTZDtype
1717

18-
def tz_to_dtype(tz): ...
19-
2018
class DatetimeArray(DatetimeLikeArrayMixin, TimelikeOps, DatelikeOps):
2119
__array_priority__: int = ...
2220
def __init__(self, values, dtype=..., freq=..., copy: bool = ...) -> None: ...
@@ -85,5 +83,3 @@ def objects_to_datetime64ns(
8583
require_iso8601: bool = ...,
8684
allow_object: bool = ...,
8785
): ...
88-
def maybe_convert_dtype(data, copy): ...
89-
def validate_tz_from_dtype(dtype, tz): ...

pandas-stubs/core/arrays/timedeltas.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,3 @@ class TimedeltaArray(DatetimeLikeArrayMixin, TimelikeOps):
6363
nanoseconds: int = ...
6464
@property
6565
def components(self) -> int: ...
66-
67-
def sequence_to_td64ns(data, copy: bool = ..., unit: str = ..., errors: str = ...): ...
68-
def ints_to_td64ns(data, unit: str = ...): ...
69-
def objects_to_td64ns(data, unit: str = ..., errors: str = ...): ...

pandas-stubs/core/common.pyi

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

pandas-stubs/core/computation/align.pyi

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

pandas-stubs/core/computation/common.pyi

Lines changed: 0 additions & 1 deletion
This file was deleted.

pandas-stubs/core/computation/expr.pyi

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import ast
33
from pandas.core.computation.ops import Term as Term
44
from pandas.core.computation.scope import Scope as Scope
55

6-
intersection = ...
7-
8-
def disallow(nodes): ...
9-
def add_ops(op_classes): ...
10-
116
class BaseExprVisitor(ast.NodeVisitor):
127
const_type = ...
138
term_type = ...
@@ -46,12 +41,6 @@ class BaseExprVisitor(ast.NodeVisitor):
4641
def visit_Compare(self, node, **kwargs): ...
4742
def visit_BoolOp(self, node, **kwargs): ...
4843

49-
class PandasExprVisitor(BaseExprVisitor):
50-
def __init__(self, env, engine, parser, preparser=...) -> None: ...
51-
52-
class PythonExprVisitor(BaseExprVisitor):
53-
def __init__(self, env, engine, parser, preparser=...) -> None: ...
54-
5544
class Expr:
5645
env: Scope
5746
engine: str

pandas-stubs/core/computation/expressions.pyi

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

pandas-stubs/core/computation/ops.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class Op:
5454
@property
5555
def is_datetime(self) -> bool: ...
5656

57-
def is_term(obj) -> bool: ...
58-
5957
class BinOp(Op):
6058
lhs = ...
6159
rhs = ...

pandas-stubs/core/computation/parsing.pyi

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

pandas-stubs/core/computation/pytables.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,3 @@ class TermValue:
106106
kind = ...
107107
def __init__(self, value, converted, kind: str) -> None: ...
108108
def tostring(self, encoding) -> str: ...
109-
110-
def maybe_expression(s) -> bool: ...

pandas-stubs/core/computation/scope.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
def ensure_scope(
2-
level: int, global_dict=..., local_dict=..., resolvers=..., target=..., **kwargs
3-
) -> Scope: ...
4-
51
class Scope:
62
level = ...
73
scope = ...

pandas-stubs/core/config_init.pyi

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@ from typing import Literal
22

33
use_bottleneck_doc: str = ...
44

5-
def use_bottleneck_cb(key) -> None: ...
6-
75
use_numexpr_doc: str = ...
86

9-
def use_numexpr_cb(key) -> None: ...
10-
117
pc_precision_doc: str = ...
128
pc_colspace_doc: str = ...
139
pc_max_rows_doc: str = ...
@@ -41,24 +37,15 @@ pc_latex_multicolumn: str = ...
4137
pc_latex_multicolumn_format: str = ...
4238
pc_latex_multirow: str = ...
4339

44-
def table_schema_cb(key) -> None: ...
45-
def is_terminal() -> bool: ...
46-
4740
max_cols: int = ...
4841
tc_sim_interactive_doc: str = ...
4942
use_inf_as_null_doc: str = ...
5043
use_inf_as_na_doc: str = ...
5144

52-
def use_inf_as_na_cb(key) -> None: ...
53-
5445
chained_assignment: Literal["warn", "raise"] | None
5546
reader_engine_doc: str = ...
5647
writer_engine_doc: str = ...
5748
parquet_engine_doc: str = ...
5849
plotting_backend_doc: str = ...
5950

60-
def register_plotting_backend_cb(key) -> None: ...
61-
6251
register_converter_doc: str = ...
63-
64-
def register_converter_cb(key) -> None: ...

pandas-stubs/core/construction.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ def array(
1010
dtype: str | np.dtype | ExtensionDtype | None = ...,
1111
copy: bool = ...,
1212
) -> ExtensionArray: ...
13-
def extract_array(obj, extract_numpy: bool = ...): ...
14-
def sanitize_array(
15-
data, index, dtype=..., copy: bool = ..., raise_cast_failure: bool = ...
16-
): ...
17-
def is_empty_data(data) -> bool: ...

pandas-stubs/core/dtypes/api.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pandas.core.dtypes.common import (
22
is_any_real_numeric_dtype as is_any_real_numeric_dtype,
3-
is_array_like as is_array_like,
43
is_bool as is_bool,
54
is_bool_dtype as is_bool_dtype,
65
is_complex as is_complex,

pandas-stubs/core/dtypes/common.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ from pandas._typing import (
1010
)
1111

1212
from pandas.core.dtypes.inference import (
13-
is_array_like as is_array_like,
1413
is_bool as is_bool,
1514
is_complex as is_complex,
1615
is_dict_like as is_dict_like,
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
from pandas._libs import lib
2-
3-
is_bool = lib.is_bool
4-
is_integer = lib.is_integer
5-
is_float = lib.is_float
6-
is_complex = lib.is_complex
7-
is_scalar = lib.is_scalar
8-
is_list_like = lib.is_list_like
9-
is_iterator = lib.is_iterator
10-
11-
def is_number(obj: object) -> bool: ...
12-
def is_file_like(obj: object) -> bool: ...
13-
def is_re(obj: object) -> bool: ...
14-
def is_array_like(obj: object) -> bool: ...
15-
def is_re_compilable(obj: object) -> bool: ...
16-
def is_dict_like(obj: object) -> bool: ...
17-
def is_named_tuple(obj: object) -> bool: ...
18-
def is_hashable(obj: object) -> bool: ...
1+
from pandas._libs import lib
2+
3+
is_bool = lib.is_bool
4+
is_integer = lib.is_integer
5+
is_float = lib.is_float
6+
is_complex = lib.is_complex
7+
is_scalar = lib.is_scalar
8+
is_list_like = lib.is_list_like
9+
is_iterator = lib.is_iterator
10+
11+
def is_number(obj: object) -> bool: ...
12+
def is_file_like(obj: object) -> bool: ...
13+
def is_re(obj: object) -> bool: ...
14+
def is_re_compilable(obj: object) -> bool: ...
15+
def is_dict_like(obj: object) -> bool: ...
16+
def is_named_tuple(obj: object) -> bool: ...
17+
def is_hashable(obj: object) -> bool: ...

pandas-stubs/core/indexers.pyi

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import numpy as np
22

3-
def is_list_like_indexer(key) -> bool: ...
4-
def is_scalar_indexer(indexer, arr_value) -> bool: ...
5-
def is_empty_indexer(indexer, arr_value: np.ndarray) -> bool: ...
6-
def check_setitem_lengths(indexer, value, values) -> None: ...
7-
def validate_indices(indices: np.ndarray, n: int) -> None: ...
8-
def maybe_convert_indices(indices, n: int): ...
9-
def length_of_indexer(indexer, target=...) -> int: ...
10-
def deprecate_ndim_indexing(result) -> None: ...
113
def check_array_indexer(arrayArrayLike, indexer): ...
124

135
class BaseIndexer:

pandas-stubs/core/indexes/api.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ from pandas.core.indexes.multi import MultiIndex as MultiIndex
66
from pandas.core.indexes.period import PeriodIndex as PeriodIndex
77
from pandas.core.indexes.range import RangeIndex as RangeIndex
88
from pandas.core.indexes.timedeltas import TimedeltaIndex as TimedeltaIndex
9-
10-
def get_objs_combined_axis(
11-
objs, intersect: bool = ..., axis=..., sort: bool = ...
12-
) -> Index: ...
13-
def union_indexes(indexes, sort=...) -> Index: ...
14-
def all_indexes_same(indexes): ...

pandas-stubs/core/indexes/base.pyi

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ from pandas._typing import (
4646
AnyAll,
4747
AxesData,
4848
DropKeep,
49-
Dtype,
5049
DtypeArg,
5150
DtypeObj,
5251
FillnaOptions,
@@ -475,9 +474,3 @@ class Index(IndexOpsMixin[S1]):
475474
) -> Self: ...
476475

477476
UnknownIndex: TypeAlias = Index[Any]
478-
479-
def ensure_index_from_sequences(
480-
sequences: Sequence[Sequence[Dtype]], names: list[_str] = ...
481-
) -> Index: ...
482-
def ensure_index(index_like: Sequence | Index, copy: bool = ...) -> Index: ...
483-
def maybe_extract_name(name, obj, cls) -> Label: ...

pandas-stubs/core/indexes/multi.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,3 @@ class MultiIndex(Index):
162162
def insert(self, loc, item): ...
163163
def delete(self, loc): ...
164164
def isin(self, values, level=...) -> np_ndarray_bool: ...
165-
166-
def maybe_droplevels(index, key): ...

pandas-stubs/core/indexing.pyi

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import TypeVar
22

3-
import numpy as np
43
from pandas.core.indexes.api import Index
54
from typing_extensions import TypeAlias
65

@@ -52,12 +51,3 @@ class _ScalarAccessIndexer(_NDFrameIndexerBase):
5251

5352
class _AtIndexer(_ScalarAccessIndexer): ...
5453
class _iAtIndexer(_ScalarAccessIndexer): ...
55-
56-
def convert_to_index_sliceable(obj, key): ...
57-
def check_bool_indexer(index: Index, key) -> np.ndarray: ...
58-
def convert_missing_indexer(indexer): ...
59-
def convert_from_missing_indexer_tuple(indexer, axes): ...
60-
def maybe_convert_ix(*args): ...
61-
def is_nested_tuple(tup, labels) -> bool: ...
62-
def is_label_like(key) -> bool: ...
63-
def need_slice(obj) -> bool: ...

pandas-stubs/core/missing.pyi

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

0 commit comments

Comments
 (0)